Skip to content

Instantly share code, notes, and snippets.

@travisrcory
Last active March 27, 2018 10:07
Show Gist options
  • Select an option

  • Save travisrcory/cddc939845294fdd9e1efbae93fbd5f6 to your computer and use it in GitHub Desktop.

Select an option

Save travisrcory/cddc939845294fdd9e1efbae93fbd5f6 to your computer and use it in GitHub Desktop.
Using Liferay Web Content structure type to import articles
<#if contents.getSiblings()?has_content>
<#assign VOID = freeMarkerPortletPreferences.setValue("view", "basicContentView") />
<#list contents.getSiblings() as cur_contents>
<#assign article = cur_contents.getData()?eval />
<#--
* This is a liferay-ui taglib that allows for rendering assets.
* It is used throughout the portal, and here we can use it to display the articles we have nested
* It accepts:
*
* className : the java className of the object model to be displayed (in our case it is JournalArticle)
* classPK : the class primary key of the asset
* template: the template to be used for rendering the article, by specifying "full_content" we are using that articles WCM template
-->
<@liferay_ui["asset-display"]
className=article.className
classPK=getterUtil.getLong(article.classPK, 0)
template="full_content"
/>
</#list>
<#assign VOID = freeMarkerPortletPreferences.reset() />
</#if>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment