Thursday Jan 12, 2012

Tips'n'Tricks for WebCenter #3: How to display custom page titles in Spaces

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. <h1>#pageDocBean.title</h1>:

edit page template

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:

<h1>#spaceContext.currentSpace.metadata.displayName &ndash; #pageDocBean.title</h1>

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:

Space's header for home page

Space's header for every other page

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:

<h1 style="margin-top: 0px; margin-bottom: 0px;">
<span style="color: #9a9a9a; font-size: 80%;">
#{pageDocBean.title != 'Home' ? spaceContext.currentSpace.metadata.displayName : ''}
</span>
<span style="color: #9a9a9a;">
#{pageDocBean.title == 'Home' ? spaceContext.currentSpace.metadata.displayName : ''}
</span>
<br />

#{pageDocBean.title != 'Home' ? pageDocBean.title : ''}
<span style="font-size: 80%;">
#{pageDocBean.title == 'Home' ? 'Information Matters' : ''}
</span>
</h1>
  • First I apply an inline style for h1 to remove some space above and below the heading.
  • Then I ask for the page title, and if it is not 'Home' (every page but the home page) then I display the space name at size 80% and gray.
  • Just for the home page I display the space name in size 100%.
  • New line for the page title.
  • Now the same distinction fot the page name. For every page but the home page I display the page title.
  • If this code is executed on the home page then I display 'Information Matters' – the tag line for the space – instead of the page title.
Yes, you are correct. Thanks for paying attention. The image of the lady is missing in my code example.

Wednesday Jan 11, 2012

Tips'n'Tricks for WebCenter #2: How to create an Admin menu in Spaces and save a lot of time

Objects in Oracle #WebCenter Portal have a visibility flag that is set to true or false. But you can also enter conditions. To make something visible just for moderators, you have to replace true by #{WCSecurityContext.userInScopedRole['Moderator']}

I use it to create an Admin menu. The visibility of the folder item in my custom navigation is specified as above. That means that all menu items under that new Admin menu are only visible for space moderators.

One candidate for such an Admin menu would be the Analytics menu item because it is not necessary to reveal it to all space members.

Another item that is extremely useful is a shortcut to Pages and Spaces Actions > Manage > All Settings. If you are a space admin you know how often you have to go there, and how difficult it is to navigate the mouse to the submenu item.

So under my new Admin menu I’ve added an item 'All Settings' with a link to http://YOURWEBCENTERDOMAIN/webcenter/spaces/YOURSPACE/admin.

You can get the link for your space via Pages and Spaces Actions > About > Share Link and append /admin. Note, that you have to check the Redirect flag under Options to avoid the frame-in-a-frame problem.

The following set of screenshot might guide you to create an Admin menu in your space.

#1 - Add a folder to the customized navigation:

add a menu

#2 - Set the Visibility to mods only:

edit Admin menu

#3 - Add links to the new Admin menu:

add menu item

#4 - Set the target path to Manage All Settings, do not forget to check the Redirect option under the Options tab:

edit Settings menu item

#5 - The customized navigation with the new Admin menu:

edit custom navigation

#6 - The customized menu applied to your space:

customized navigation

Republished at theappslab.com

 

Tips'n'Tricks for WebCenter #1: How to apply custom resources in Spaces

This is the beginning of a little series of tips'n'tricks for Oracle #WebCenter Portal Spaces. The background is our migration from Confluencethat we used at Sun – to WebCenter Spaces as a collaboration tool for the VDI engineering team. I want to share my insights so that other teams and users can get a smooth(er) start with WebCenter.

As a space owner and administrator you might have been to Pages and Spaces Actions > Mange > All Settings

Actions - Manage - All Settings

… then opened the Resources tab, and skimmed through the lists of page templates, navigations, and skins. And you might have asked yourself, "which of these is actually used in my space?"

It took me quite some time to figure it out. And that's the reason for this posting. You are looking at the wrong spot! You have to go to Pages and Spaces Actions > Mange > All Settings > General to look at the right column under Display Settings. This is the control area where you set the default Page Template, Skin, and Navigation for your space:

WebCenter Spaces - Display Settings

So in order to customize any of these for your space, you have to copy an existing resource, add your changes, save, go to the General tab and select your new Page Template, Skin, or Navigation. If you go now back to your space you can see the change in action, a new page template, an updated look and feel, or a new menu bar.

Republished at theappslab.com

About

Search

Categories
Archives
« April 2014
SunMonTueWedThuFriSat
  
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
   
       
Today