| About When editing a portal page, you can add custom page parameters (metadata) to the page. The value of a custom page parameter can then be retrieved from your WPS theme code. This explains how. |
First, you must add a custom parameter to one or more portal pages.
This is done in the Edit Page view > Advanced options > I want to set parameters.
You can then access the named parameters in your theme code.
Take the following parameter name for example:
| Name | com.acme.page.hidden |
|---|---|
| Value | true |
Following is an example where this technique is used to determine whether or not a tab for a portal page should be rendered in the UI. This is taken from a theme file called topNav.jspf.
| Side Note To access the custom unique name for the page, try this using the same wpsNavNode object that is shown as available within the portal-navigation loop above: <%= wpsNavNode.getContentNode().getObjectID().getUniqueName() %> |
A different approach
By using the <portal-logic> tag we can obtain all the parameters on a page, here is an example:
1 Comment
comments.show.hideNov 03, 2010
Anonymous
Hi. This article is very usefull but apparantly works only for the parameters specified specifically for the page. If the parameters are inherited, they are not see by this code. Do you have any idea how this can be fixed? I have searched and nowhere is mentioned about such problem and yet I experience it
Thank you, Oli