Message Boards

Instance ID of a theme embedded portlet

Vishnu S Kumar, modified 3 Years ago.

Instance ID of a theme embedded portlet

Regular Member Posts: 131 Join Date: 7/28/17 Recent Posts
The portlet is added in the theme like this: 
<@liferay_portlet["runtime"]  instanceId="portlet-id-12345" 
                        portletName="name-of-the-portlet" />
since the instance Id is hard coded in the theme , all the instances of the portlet has the same instance Id. Therefore, we can't add different portlet instance configurations on different pages. How to manage instance Id on embedded portlets so that it will be always same for a portlet instance but different on other pages.? Same behavior as of other portlets added directly on to the pages.
Soumyashree Mishra, modified 3 Years ago.

RE: Instance ID of a theme embedded portlet (Answer)

Junior Member Posts: 32 Join Date: 4/18/16 Recent Posts
Hi Vishnu,
You can give the layout plid as the instance id while embedding the portlet. This way every page will have a different instance Id.HTH!
Vishnu S Kumar, modified 3 Years ago.

RE: Instance ID of a theme embedded portlet

Regular Member Posts: 131 Join Date: 7/28/17 Recent Posts
Worked like a charm. Thanks