Ask Questions and Find Answers
Important:
Ask is now read-only. You can review any existing questions and answers, but not add anything new.
But - don't panic! While ask is no more, we've replaced it with discuss - the new Liferay Discussion Forum! Read more here here or just visit the site here:
discuss.liferay.com
Displaying new type article field in web content template (7.2 GA2 CE)
Hi guys,
I'm using for the first time a field of type "Article" in a structure. Editing a web content with such a field works well, so now we must display it in a template.
The first problem seems to be that the web content template editor is not providing working code for this article. It's generating an invalid URL, since getFriendlyUrl() is not working:
Does anybody know if there is a faster way to get to the article than using serviceLocator, JournalArticleServiceUtil and getArticleDisplay() ?
TIA
Fernando
I'm using for the first time a field of type "Article" in a structure. Editing a web content with such a field works well, so now we must display it in a template.
The first problem seems to be that the web content template editor is not providing working code for this article. It's generating an invalid URL, since getFriendlyUrl() is not working:
<#assign
webContentData = jsonFactoryUtil.createJSONObject(DirectionsArticle.getData())
/><a href="${DirectionsArticle.getFriendlyUrl()}">
${webContentData.title}
</a>Anyway, what I would like to do is to display the article using <@liferay_journal["journal-article"] articleId=... groupId=... />. But the getData() method is only providing the className, classPK and title. Does anybody know if there is a faster way to get to the article than using serviceLocator, JournalArticleServiceUtil and getArticleDisplay() ?
TIA
Fernando