The default theme features a customize link that allows you to easily add a blog or wiki to a page. If you have a theme that is not based on the default theme, this capability can still be added with some minor changes to your theme.
This article provides you with one example of how you can modify your theme to enable the capability of adding blogs and wikis to a page from the page menu. The portal logic tag has been used in this example to only add the blogWiki code to pages when a user is logged into the site. You will need to add additional logic if further restrictions are required for who can access the new menu items.
Note: The instructions in this article are specific to IBM® WebSphere® Portal version 7.0.
1. Save the blogWiki_v70.jspf file into the directory that contains your custom theme files. Refer to the "Creating a new theme" topic for more information:
2. Modify the theme's Default.jsp file to also include the blogWiki.jspf file. This file should be located in the same directory. Add the following line before the <body> tag:
<portal-logic:if loggedIn="yes" ><%@ include file="./blogWiki_v70.jspf" %></portal-logic:if>
3. Modify the user interface of your theme so that users can select the option to add a blog or wiki to a page. In this example, the page menus are modified to include new menu selections for adding blogs and wikis to the current page.
Edit the pageContextMenu.jsp file and add the following lines before the "return contents;" part of the jspInit() method:
contents[i]='Create Blog Library';
4. Save your changes to the pageContextMenu.jsp file.
Three new menu items should appear in the page menu for any pages that are using your theme. A user will be shown a dialog asking to name the new blog or wiki that is to be created. After this name is entered, the user will be shown an animation dialog while the creation process finishes.
The function that is being called by all three menu items is createBlogOrWiki(), and a single parameter is passed in that defines the type of resource that should be created: a blog, a wiki, or a blog library. This function is located in the blogWiki.jspf file.
If you have another user interface element that you would like to use in your own theme rather than the menu items shown here, you will need to have the createBlogOrWiki function called as a result of the user interacting with your UI element.
Also, you can modify the functions located in the blogWiki.jspf to change the dialogs that are presented to the user to better integrate with the the look of your theme.