Embed portlet in liferay 7 FTL theme
To include portlet in liferay 7 ftl theme , use the code as follows.
<@liferay_portlet["runtime"]
defaultPreferences="${freeMarkerPortletPreferences}"
portletProviderAction=portletProviderAction.VIEW
instanceId="blablabla1"
portletName="com_liferay_site_navigation_directory_web_portlet_SitesDirectoryPortlet"
/>
where ,
instanceId="blablabla1" have to be given only for instanceable portlet,
"com_liferay_site_navigation_directory_web_portlet_SitesDirectoryPortlet" is portletId.
<@liferay_portlet["runtime"]
defaultPreferences="${freeMarkerPortletPreferences}"
portletProviderAction=portletProviderAction.VIEW
instanceId="blablabla1"
portletName="com_liferay_site_navigation_directory_web_portlet_SitesDirectoryPortlet"
/>
where ,
instanceId="blablabla1" have to be given only for instanceable portlet,
"com_liferay_site_navigation_directory_web_portlet_SitesDirectoryPortlet" is portletId.
Hi,
ReplyDeleteI am trying to embed a portlet into the theme, but nothing will show up.
First I created via blade a portlet provider which already contains a portlet preconfigured as a AddPortletProvider. Then I changed it to a ViewPortletProvider.
After that I tried to embed the portlet the way you mentioned above.
But nothing will show up, no errors.
Thx for every feedback, I appreciate that.
In addition, I did not use the instanceId property mentioned above.
ReplyDeletePlease check whether you have given correct portlet name. And, instanceId have to be given only for instanceable portlet as I mentioned in the post.
DeleteHi,
Deletethis is what I have implemented
<@liferay_portlet["runtime"]
defaultPreferences="${freeMarkerPortletPreferences}"
portletProviderAction=portletProviderAction.VIEW
portletName="DisplayMessagesViewPortletProvider2"
/>
The portlet component header is:
"javax.portlet.name=" + DisplayMessagesViewPortletProviderPortletKeys.DisplayMessagesViewPortletProvider
And behind "DisplayMessagesViewPortletPovider" = DisplayMessagesViewPortletProvider2
If I changed the name of the porlet in the ftl. There is an error which cannot find the portlet with the name...
Thx for the hints.
DeleteMy portlet was instanceable, so I set it to false in the component header and then the content showed up.
After you said instanceId, I checked my portlet again.
Thx again.