Reputation: 107
I'm following this guide: https://dev.liferay.com/es/develop/tutorials/-/knowledge_base/7-0/embedding-portlets-in-themes-and-layout-templates to embed a custom portlet into a custom layout template but I'm stuck at step 4:
Specify the methods you want to implement. Make sure to retrieve the portlet ID and page ID that should be provided when this service is called by your theme.
Where do I get the ID of my custom portlet? Also, the example provided doesn't implement thegetPortletId()
method and instead shows getPortletName()
which only returns a static String. I have come across many similar questions but none of them seem to relate to Liferay version 7.
Upvotes: 0
Views: 966
Reputation: 1
The portlet id and portlet name in this case is the same. The static string you are searching for is the qualified name of the portlet class but dots replaced with underscores. E.g. for the MyAccount portlet the classname is com.liferay.my.account.web.portlet.MyAccountPortlet and the portlet id is com_liferay_my_account_web_portlet_MyAccountPortlet. Same rule applies for custom portlets.
Upvotes: 0