Skip to content

Instantly share code, notes, and snippets.

@elindoorn
elindoorn / reserved-web-content-variables.txt
Last active October 13, 2023 14:26
Reserved web content variables
reserved-article-asset-tag-names
reserved-article-author-comments
reserved-article-author-email-address
reserved-article-author-id
reserved-article-author-job-title
reserved-article-author-location
reserved-article-author-name
reserved-article-author-organization
reserved-article-create-date
reserved-article-description
@gonzalezalo
gonzalezalo / using-templates-in-adt.ftl
Last active June 29, 2022 11:01
Using Liferay WebContent Template from ADT - Liferay 7
<#-- Liferay info on templates: https://dev.liferay.com/discover/portal/-/knowledge_base/7-0/designing-uniform-content -->
<#-- There is more than just a way of doing this: -->
<#-- Option 1 -->
<#assign journalArticleLocalService = serviceLocator.findService("com.liferay.journal.service.JournalArticleLocalService")>
<#if entries?has_content>
<#list entries as curEntry>
<#assign article = curEntry.getAssetRenderer().getArticle() />
<#assign model = objectUtil("com.liferay.portal.kernel.portlet.PortletRequestModel", renderRequest, renderResponse) />
<#if entries?has_content>
encontrei conteudo <br><hr>
<#list entries as curEntry>
<h3>Entries:</h3> ${curEntry} <br><hr>
<!-- PROPRIEDADES QUE ESTÃO DISPONÍVEIS -->
<H3>propriedades disponíveis:</H3>
<b>entryId</b>: ${curEntry.entryId} <br>
@evertonthepaula
evertonthepaula / gist:f361f5c535783ded257470a9ac5d800e
Last active July 9, 2021 18:18
Liferay - ADT - get dynamic fields value
<#if entries?has_content>
<#list entries as curEntry>
<#assign AssetRenderer = curEntry.getAssetRenderer()>
<#assign journalArticle = AssetRenderer.getArticle() />
<#assign document = saxReaderUtil.read(journalArticle.getContent()) />
<#assign rootElement = document.getRootElement() />
<!-- FORMA 01 -->
<#list rootElement.elements() as dynamicElement>