Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Select an option

  • Save jverweijL/5748a1af0c7429a81e497e518972fdcc to your computer and use it in GitHub Desktop.

Select an option

Save jverweijL/5748a1af0c7429a81e497e518972fdcc to your computer and use it in GitHub Desktop.
<#--
Web content templates are used to lay out the fields defined in a web
content structure.
Please use the left panel to quickly add commonly used variables.
Autocomplete is also available and can be invoked by typing "${".
-->
<#assign AssetCategoryLocalService = serviceLocator.findService("com.liferay.asset.kernel.service.AssetCategoryLocalService") />
<#assign JournalArticleLocalService = serviceLocator.findService("com.liferay.journal.service.JournalArticleLocalService") />
<#assign journalArticle = JournalArticleLocalService.getArticle(getterUtil.getLong(groupId),.vars['reserved-article-id'].data) />
<#assign categories = AssetCategoryLocalService.getCategories("com.liferay.journal.model.JournalArticle", journalArticle.getResourcePrimKey()) />
<h2>${Position.getData()}</h2>
<p>
<#if categories?has_content>
<#list categories as category>
${category.getName()}${category?has_next?then(' | ', '')}
</#list>
</#if>
</p>
<p>
${Intro.getData()?substring(0, 100)}...
</p>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment