In this recipe, we will export the sitemap configuration from the portal and update the navigation.xml
file to hide the page. Once updated, the ZIP will be imported back into the portal to overwrite the existing configuration for the sitemap.
The following are required for this recipe:
To remove the sitemap page from the navigation:
> ssh -p 2000 root@localhost
> mgmt connect
> export --file /tmp/mop.zip --filter site-name:classic;page-name:sitemap;nav-uri:sitemap /mop
navigation.xml
in the portal/classic
folder of the ZIP file by changing DISPLAY
to HIDDEN
in the <visibility>
tag of the sitemap navigation element.http://localhost:8080/portal
to see the SiteMap menu option next to Home on the homepage, as shown in the following screenshot:> import --file /tmp/mop.zip /mop
Step 6 exports the configuration from the classic portal, applying filters to only retrieve the sitemap page and navigation. It was not strictly necessary to filter for sitemap, but it makes it simpler to find the entry you want to edit and it also prevents inadvertently editing other navigation nodes or pages and potentially corrupting the portal.
Step 8 edits the navigation.xml
to mark the SiteMap as HIDDEN
.
Step 10 imports the mop.zip
content back into the portal. As an import-mode
was not specified, it uses the default of merge
, which updates existing data that already exists and creates it when it doesn't. If the import-mode
was set to conserve
or insert
in our recipe, then no change would have been applied to the portal.
Now we'll show some other ways the navigation of the portal can be modified.
Instead of removing the SiteMap from the navigation, we could move it to beneath the Home menu.
To move the SiteMap menu item:
> export --file /tmp/mop.zip --filter site-name:classic /mop
mop.zip
and edit navigation.xml
.<node>
containing the sitemap to before </node>
of the homepage node. It should now look as follows:<page-nodes> <node> <name>home</name> <label xml:lang="en">Home</label> <visibility>DISPLAYED</visibility> <page-reference>portal::classic::homepage</page-reference> <node> <name>sitemap</name> <label xml:lang="en">SiteMap</label> <visibility>DISPLAYED</visibility> <page-reference>portal::classic::sitemap</page-reference> </node> </node>
mop.zip
.> import --file /tmp/mop.zip --importMode overwrite /mop
http://localhost:8080/portal
, or refresh the home page if you are already there. It should now appear as the following screenshot:It is also possible to edit the labels of a navigation node, and therefore change the name that is visible to the user within the portal.
To modify the navigation node label:
> export --file /tmp/mop.zip --filter site-name:classic /mop
mop.zip
and edit navigation.xml
.<node>
section and set the value within <label xml:lang="en">
to Page List
.mop.zip
.> import --file /tmp/mop.zip --importMode overwrite /mop
http://localhost:8080/portal
. It should now appear as the following screenshot:18.218.171.212