Fetching the web content by using the name in theme
The below velocity code is used for fetching the web content by using the name:
#set ($journalArticleLocalService = $serviceLocator.findService("com.liferay.portlet.journal.service.JournalArticleLocalService"))
#set ($journalContentUtil = $utiLocator.findUtil("com.liferay.portlet.journalcontent.util.JournalContentUtil"))
// footer is my web content name
#set ($footerContent = "footer")
#set ($journalArticle = $journalArticleLocalService.getLatestArticleByUrlTitle($themeDisplay.getScopeGroupId(),$footerContent , 0))
// To display the web content
$journalContentUtil.getContent($group_id,$journalArticle.getArticleId() ,null,$locale.toString(),$theme_display)
Comments
Post a Comment