Skip to content

Instantly share code, notes, and snippets.

@rotty3000
Last active December 21, 2015 07:19
Show Gist options
  • Save rotty3000/6270526 to your computer and use it in GitHub Desktop.
Save rotty3000/6270526 to your computer and use it in GitHub Desktop.
velocity template
#set( $logFactory = $portal.getClass().forName('com.liferay.portal.kernel.log.LogFactoryUtil') )
#set( $log = $logFactory.getLog('contentLoadingTemplateTest') )
<ul style="list-style-type: none">
#set( $group_id = $getterUtil.getLong($request.theme-display.scope-group-id) )
#set( $contentId = $teaser1-content-id.data)
#set( $content = $journalContentUtil.getContent($group_id, $contentId, $viewMode, "$locale", $xmlRequest) )
#if( $content && $content != "" )
$content
#else
$log.error("Web content with ID '$!contentId' could not be found in web content '$reserved-article-title.data' (ID: $reserved-article-id.data)!")
<!-- ERROR: Web content with ID '$!contentId' could not be found in web content '$reserved-article-title.data' (ID: $reserved-article-id.data)! -->
#end
</ul>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment