掲示板
[SOLVED] Asset Publisher Friendly url
13年前 に Francesco Marangi によって更新されました。
[SOLVED] Asset Publisher Friendly url
New Member 投稿: 9 参加年月日: 09/02/06 最新の投稿
Hi everyone,
In previous versions of Liferay, we could display selected articles from a Velocity template in an Asset Publisher by using the friendly URL
This was working pretty fine.
However, in version 6, the asset publisher is behaving a bit differently, allowing the use of friendly urls for articles.
The new request URL looks like
E.g., if the article title is "Liferay Test - This is just a test", the friendly Url looks like:
How do I access/generate the Friendly URL for a specific article in Velocity template context?
In previous versions of Liferay, we could display selected articles from a Velocity template in an Asset Publisher by using the friendly URL
[PAGE_URL]/-/asset_publisher/[PORTLET-INSTANCE-ID]/content/[ARTICLE-ID]
This was working pretty fine.
However, in version 6, the asset publisher is behaving a bit differently, allowing the use of friendly urls for articles.
The new request URL looks like
[PAGE_URL]/-/asset_publisher/[PORTLET-INSTANCE-ID]/content/[ARTICLE-FRIENLY-URL]
E.g., if the article title is "Liferay Test - This is just a test", the friendly Url looks like:
[PAGE_URL]/-/asset_publisher/[PORTLET-INSTANCE-ID]/content/liferay-test-this-is-just-a-test
How do I access/generate the Friendly URL for a specific article in Velocity template context?
13年前 に Francesco Marangi によって更新されました。
RE: [SOLVED] Asset Publisher Friendly url
New Member 投稿: 9 参加年月日: 09/02/06 最新の投稿
I accidentally found the solution to that. In case anybody is interested, in journal template context, the variable $reserved-article-url-title.data returns exactly the URL title of the article.
To open the article in an asset publisher placed in a different page, you can do something like this:
To open the article in an asset publisher placed in a different page, you can do something like this:
#set($page_url = "YOUR_PAGE_URL")
#set($instance_id = "PORTLET_INSTANCE_ID")
${page_url}/-/asset_publisher/${instance_id}/content/${reserved-article-url-title.data}
11年前 に Brian Scott Schupbach によって更新されました。
RE: [SOLVED] Asset Publisher Friendly url
Expert 投稿: 329 参加年月日: 08/10/23 最新の投稿
For an even "friendlier" URL and instructions for version 6.1 checkout this post
http://www.liferay.com/community/forums/-/message_boards/message/16588582
http://www.liferay.com/community/forums/-/message_boards/message/16588582
8年前 に juan meza によって更新されました。
RE: [SOLVED] Asset Publisher Friendly url
Regular Member 投稿: 228 参加年月日: 14/01/06 最新の投稿
in case you dont know how to get instance id or url title, here is with the actual variables:
#set ($urlarray = $currentURL.split("\?"))
#set($site = $urlarray.get(0))
<a href="${site}/-/asset_publisher/$portletDisplay.instanceId/content/$journalArticle.urlTitle">Read More</a>
7年前 に Michal Sima によって更新されました。
RE: [SOLVED] Asset Publisher Friendly url
New Member 投稿: 24 参加年月日: 13/02/27 最新の投稿
Is it possible to generate such URL but to show a web content from the GLOBAL scope?