If people don’t know where they are in the web, they tend to get lost in cyberspace. This can be prevented by displaying the page title for your pages in Oracle #WebCenter Portal Spaces. (At least they won’t get lost in your WebCenter space.) All you have to do is to create a custom page template and use it as default in your space. Its head section will contain a few code snippets to display the title. Add an HTML box and enter e.g.#pageDocBean.title
That's it. That is the basic idea.
Caveat: This does not work for wiki pages and HTML pages because they do not have a specific title in WebCenter. #pageDocBean.title will just return 'Wiki' or 'Resource'.
Now let's get a little bit more sophisticated. A space has a title as well. So let's use it:
#spaceContext.currentSpace.metadata.displayName – #pageDocBean.title
Are you ready for level 3? Now I want to add more styling, and I want to have a special treatment for the home page to display the tagline for the space. Here is a preview of the final result, first the home page, then any other page in the space:
To accomplish this behavior, I have to use a conditional statement #{ BOOL ? CASE1 : CASE2 }. WebCenter's expressions cannot be nested, hence the conditions will be tested several times to get the desired result:
#{pageDocBean.title != 'Home' ? spaceContext.currentSpace.metadata.displayName : ''}
#{pageDocBean.title == 'Home' ? spaceContext.currentSpace.metadata.displayName : ''}
#{pageDocBean.title != 'Home' ? pageDocBean.title : ''}
#{pageDocBean.title == 'Home' ? 'Information Matters' : ''}
Yes, you are correct. Thanks for paying attention. The image of the lady is missing in my code example.