Search code examples
portalwebsphere-portal

hide pages in websphere portal without using set parameters


I am using WebSphere Portal 8.5 Enable. I have created a custom theme. But this theme requires to hide pages on navigation which has unique name with ".omit." value in it, so that I don't have to manually set each page's parameter.
I created the flyout or menu dropdown using this: Flyout or Menu Dropdown in Portal 8 themes
Any suggestions and pointers are welcome. Thanks in advance.


Solution

  • Maybe you have already thought about this.

    The solution you mentioned (Flyout or Menu Dropdown in Portal 8 themes) hides nodes based on the hidden flag. This method is used to calculate it. Now you could query the uniquename of the Node witin this method and check for your naming pattern and use this to determine if it is hidden. It would allow you to combine the two as well.

    the method I think you need to modify.

    public boolean isHiddenPage(NavigationNode node){
        if (node instanceof com.ibm.portal.MetaDataProvider) {
            com.ibm.portal.MetaData iMetaData=((com.ibm.portal.MetaDataProvider) node).getMetaData();
            Object url=iMetaData.getValue("hide.from.menu");
            return (url != null && url.toString().equals("true"));
        }
        return false;
    }