Issue
- I have upgraded from DXP 7.0 to DXP 7.4. After the upgrade, the hidden pages are not visible on the menu display portlet in DXP 7.4.
Reproduction Steps:
-
Set up DXP 7.0 with the latest fix pack.
-
Go to Control Panel → Navigation → and click on the kebab menu beside “Public Pages”, add a Public Page, and make it hidden by enabling the option “Hide from Navigation Menu”. Notice that it states: If enabled, this page does not show up in the navigation menu.
-
Now create a child Page to this hidden parent page. Do not hide the child page.
-
Create another public page, place on it a Navigation Menu, and configure it to display the previously created hidden Page by clicking the menu under “Root Page” and setting it to “Select”
Checkpoint: Now, we can see the hidden Page with its child page and select it to be displayed on the menu.
5. Shut down the instance.
6. Upgrade to DXP 7.4.
Result: The hidden Page is not displayed on the Menu Display portlet along with its child page.
Environment
- Liferay DXP 7.4
Resolution
- The behavior is expected. The option to hide the page from the navigation menu means that the Page will not be displayed on the default Navigation Menu Portlet. However, in DXP 7.0 this option was not working (this is a bug), and therefore, it was possible to configure hidden pages in the navigation menu in 7.0 to be displayed.
- This issue has been resolved in later Liferay versions. This means that hidden pages will not be displayed on the default Menu Display Portlet of DXP 7.4.
- To fix this issue, you will need to create a Menu Display by going to Site Builder --> Navigation Menus and adding the hidden pages to be displayed on this created Menu Display Portlet.
- If you have many hidden pages and would like to save time on configuring each page, you can use the attached Groovy Script "setCustomField.groovy.txt" that copies the hidden from the navigation menu property of a page to a new expando field (Custom Field) and sets all pages as not hidden. The script is idempotent. Once the custom field is set to true, it cannot be reversed (this is to avoid setting it back to false if you run it a second time because the script has also reset the hidden from the navigation menu property). CustomMenuTemplate.ftl.txt is a sample ADT for the Menu Display Portlet which reads the custom field through the expando bridge. NOTE: Kindly make a backup of your database before running the script and test it first in a lower environment.