I have defined:
- A structure
- Two or mote templates associated to the structure (full content, short block abstract, ...)
- A web content in the given structure
in a different template I have the functions to gather the reference to my article; I wish to render an article with a given template.
...
#set( $templateId = 27121)
#set ($DDMTemplateLocalService = $serviceLocator.findService("com.liferay.portlet.dynamicdatamapping.service.DDMTemplateLocalService"))
#set( $ddmTemplate = $DDMTemplateLocalService.getTemplate($templateId))
#if( ( $articleId != $reserved-article-id.data ) )
#set( $webContent = $journalContentUtil.getContent( $groupId, $articleId, $ddmTemplate.getPrimaryKey(), "view", "$locale", $xmlRequest ) )
#if ( $webContent )
<div>${webContent}</div>
#else
<div>Cannot use $templateName</div>
#end
#end
... the variable $webContent is always empty .