I have found how to embed WebContent in Liferay 6.2 theme using journalContentUtil.getContent
method. My question is how to do the same thing in Liferay 7?
I have found the way fix web content via custom ftl template in Liferay 7/DXP.
Below is the sample code,
<#assign VOID = freeMarkerPortletPreferences.setValue("portletSetupPortletDecoratorId", "barebone") />
<#assign theme_groupID = htmlUtil.escape(theme_display.getCompanyGroupId()?string) />
<#assign VOID = freeMarkerPortletPreferences.setValue("groupId", '${group_id}') />
<#assign VOID = freeMarkerPortletPreferences.setValue("articleId", "yourarticleid") />
<@liferay_portlet["runtime"]
defaultPreferences="${freeMarkerPortletPreferences}"
portletProviderAction=portletProviderAction.VIEW
instanceId="footercontent"
portletName="com_liferay_journal_content_web_portlet_JournalContentPortlet" />
${freeMarkerPortletPreferences.reset()}
Make sure the articleId which you are providing in preferences is under the groupId.Means group/site should contains the webcontent.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With