How to include custom portlet in theme - Liferay DXP

Leave a Comment
How to include custom portlet in theme You can include out of box as well as custom portlet inside theme in Liferay dxp but way has been changed.

By default Liferay uses free marker templates for theme. You can use below snippet to include any custom portlet in theme.


<#assign VOID = freeMarkerPortletPreferences.setValue("portletSetupPortletDecoratorId", "barebone")>

<@liferay_portlet["runtime"]
 defaultPreferences="${freeMarkerPortletPreferences}"
 portletProviderAction=portletProviderAction.VIEW
 portletName="com_custom_portlet_themesearch_ThemeSearchPortlet" />

In above example we have included custom portlet called 'Theme Search Portlet' in theme. You can also change preferences for portlet added in theme by passing preferences object to defaultPreferences attribute.

Read other posts on Liferay DXP

How To Read Portlet.Properties File In Liferay DXP
How to include static resources (CSS/JS/Images) in Liferay OSGI module
How To Specify External Jar Dependency In Liferay DXP
How To Specify Module Dependencies In Liferay DXP
How To Disable Re-Indexing Of All Journal Article Versions In Liferay DXP

Next PostNewer Post Previous PostOlder Post Home

0 comments:

Post a Comment