留言板
How get name of portlet
I want to display the detail of one article, and i want the name of this article for example:
http://localhost:8080/web/web-test/ofertas/-/asset_publisher/xLxPkbeLt8IB/content/new-york
the name is new-york
i can use $curEntry.getTitle($locale) and replace the space for '-' but when the client change the name of the article for example NewYork the name it's still new-york but getTitle return NewYork and i cant do that...
How can get this identificator "new-york"?
http://localhost:8080/web/web-test/ofertas/-/asset_publisher/xLxPkbeLt8IB/content/new-york
the name is new-york
i can use $curEntry.getTitle($locale) and replace the space for '-' but when the client change the name of the article for example NewYork the name it's still new-york but getTitle return NewYork and i cant do that...
How can get this identificator "new-york"?
This identifier is the url title of the content, which is used to create direct display links for journalarticles.
This is a specific property for journalarticles ( see also https://docs.liferay.com/portal/6.2/javadocs-all/com/liferay/portlet/journal/model/JournalArticleModel.html#getUrlTitle() )
You best best is to retrieve the article from the renderer, and then retrieve the url title
This is for 6.2, check whether the fully qualified classname of journalarticle is still the same in 7 if you are using 7.
This is a specific property for journalarticles ( see also https://docs.liferay.com/portal/6.2/javadocs-all/com/liferay/portlet/journal/model/JournalArticleModel.html#getUrlTitle() )
You best best is to retrieve the article from the renderer, and then retrieve the url title
This is for 6.2, check whether the fully qualified classname of journalarticle is still the same in 7 if you are using 7.
#foreach ( $entry in $entries )
#set ( $renderer = $entry.getAssetRenderer() )
#set ( $className = $renderer.getClassName() )
#if ( $className == "com.liferay.portlet.journal.model.JournalArticle" )
## ARTICLE PROPERTIES
#set ( $article = $renderer.getArticle() )
#set ( $urlTitle = $article.getUrlTitle() )
#end ## class
#end ## each