Issue
- ID of the portlet instance is different in the staging environment than in the real environment
- Steps to reproduce:
- Add a content editor portlet to a page.
- Go to staging.
-
In staging: Edit "Configuration"
- Go to "Advanced styles" tab.
- Click on the button "Add CSS code for this portlet only" and add the following code in "Enter custom CSS styles": #portlet_com_liferay_asset_publisher_web_portlet_AssetPublisherPortlet_INSTANCE_OCHcO7s000oU { }
- Modify the style to change a title: #portlet_com_liferay_asset_publisher_web_portlet_AssetPublisherPortlet_INSTANCE_OCHcO7s000oU h5 { margin-top: 10px; margin-bottom: 5px; }
- Carry out the staging, and the modification has no effect!
- Enter production and go to the portlet and enter "Configuration"
- Go to the tab "Advanced styles"
- The code added in staging is as it is.
- Click on the button "Add CSS code for this portlet only", and it adds the same as in staging.
- Let's go to production without logging in and with the browser inspector we look for the portlet with the id "portlet_com_liferay_asset_publisher_web_portlet_AssetPublisherPortlet_INSTANCE_OCHcO7s000oU"
Result: Does not appear! Instead a portlet appears with following ID: "p_p_id_com_liferay_asset_publisher_web_portlet_AssetPublisherPortlet_INSTANCE_OCHcO7s000oU_".
Notice that it is almost the same. It starts differently and ends differently. But the central part is the same. At first change "portlet" to "p_p_id" and at the end add "_".
Environment
- Liferay DXP 7.0
Resolution
- This issue arises only when there has been a manual intervention in theme's portlet.ftl file.
- To be precise, in portlet.ftl, if below tag has been modified or omitted, then styling cannot be guaranteed:
<section class = "portlet" id = "portlet _ $ {portlet_id}"> - Adding this styling would resolve the issue.