Can someone tell me how to figure out what portal page name I am on in the theme? I would like to be able to do this outside of the navigation tags. Basically I want to display a customized message based on what portal page you are in using jsp.
You should be able to get the selected node by calling getSelectedNode() on the NavigationSelectionModel. Check the SPI.
getSelectedNode() should return a NavigationNode. Get the ContentNode from the NavigationNode and call getTitle() on it.
Is there a code sample I can look at? Sorry I am having some problems with the syntax working in the portal page. Been banging my head against it all day.
You have probably figured this out by now... but the error is because
your "cn" object is defined of type "java.lang.Object" and
java.lang.Object does not have a getContentNode() method.
A simpler example to look at would be to examine banner_crumbtrail.jspf.
The only difference is that you don't want to output every node in the
path of selected nodes. You only want the leaf node. So, use the
iterator to locate the last node in the list and that will be the
selected page.
Even though the Portal 6 themes still seem to be using a deprecated way of
doing this I think it would be simpler to avoid the iteration if you actually use the SPI ( a tag handler, probably )
Context ctx = new InitialContext();
NavigationSelectionModelHome home = (NavigationSelectionModelHome) ctx.lookup("portal:service/model/NavigationSelectionModel");
if (home != null) {
NavigationSelectionModel model =
home.getNavigationModelProvider().getNavigationModel(aRequest, aResponse);