Fóruns

Início » Liferay Portal » English » 3. Development

Visualização combinada Visão plana Exibição em árvore
Tópicos [ Anterior | Próximo ]
toggle
Francesco Marangi
[SOLVED] Asset Publisher Friendly url
26 de Janeiro de 2011 08:21
Resposta

Francesco Marangi

Ranking: New Member

Mensagens: 9

Data de entrada: 6 de Fevereiro de 2009

Mensagens recentes

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

1[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

1[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:

1[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?
Francesco Marangi
RE: [SOLVED] Asset Publisher Friendly url
26 de Janeiro de 2011 08:27
Resposta

Francesco Marangi

Ranking: New Member

Mensagens: 9

Data de entrada: 6 de Fevereiro de 2009

Mensagens recentes

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:

1
2#set($page_url = "YOUR_PAGE_URL")
3#set($instance_id = "PORTLET_INSTANCE_ID")
4${page_url}/-/asset_publisher/${instance_id}/content/${reserved-article-url-title.data}
Brian Scott Schupbach
RE: [SOLVED] Asset Publisher Friendly url
21 de Setembro de 2012 05:53
Resposta

Brian Scott Schupbach

Ranking: Expert

Mensagens: 331

Data de entrada: 23 de Outubro de 2008

Mensagens recentes

For an even "friendlier" URL and instructions for version 6.1 checkout this post

http://www.liferay.com/community/forums/-/message_boards/message/16588582