Accessing Article Information in Web Content Templates
While, it’s pretty simple to access journal article structure fields in template: (you have all these fields listed, and even code sample is generated when you click on it), accessing article information (articleId, author, etc.) is not such straightforward. Solution: To access such information you may use the following syntax: <#assign journalArticleId = . vars [ 'reserved-article-id' ]. data /> This will get the articleId of the article being displayed by the template. In a similar way you can access other fields, sample: <#assign createDate = . vars [ 'reserved-article-create-date' ]. data /> <#assign author = . vars [ 'reserved-article-author-name' ]. data /> All these fields are listed in com.liferay.journal.model.JournalStructureConstants class: public class JournalStructureConstants { public static final String RESERVED = "reserved" ; public static final String RESERVED_ARTICLE_ASSET...