Showing posts with label themes skins. Show all posts
Showing posts with label themes skins. Show all posts

Tuesday, April 14, 2009

Customizing Themes & Skins in WebSphere Portal: how to add custom items to the portlet context menu

As we know the Portlet Context Menu contains controls to change the portlet's mode, state, and position on a page.In figure below, you can see that with different access rights, you have the ability not only to change the mode and the state, but also to change where that portlet renders on the page. From this menu, you can either move the portlet down in the order of the page or move it to the column on the right.



The above figure shows that the portlet context menu varies based on factors such as permission, placement, and the portlet with which it is interacting. Additionally, this menu is extensible in two ways. First, you can add items directly to the JSP file that renders the portlet context menu; Second, you can use theme extensions to add items to the menu with little coding involved.

To Know how to add a custom item option in portlet Context menu using theme extensions Click Here.



Friday, April 10, 2009

Know how to remove the Minimize, Maximize and other options out of the portlet context menu in WebSphere Portal 6.0...

Working on my current project, I had a requirment to remove portlet context menus such has Maximize, Minimize, Move up, Move right etc from the Portlet Context Menu. Themes and skins in WebSphere Portal provide the framework for the UI, which includes page navigation, page layout, containers to hold portlet-rendered markup, and controls for user interaction. The title of the portlet as well as the portlet context menu are the part of the skin is rendering. Control.jsp in skin folder is basically responsile to render the portelt title and portlet Context menu. Following code in Control. jsp is responsible for portelt context menu


The URL generated from the code in listing 2 targets the JSP file that renders the portlet context menu, the themeTemplate attribute tells WebSphere Portal what JSP file to render, and the value in themeTemplate must match the file name of the JSP file excluding the file extension, which in our case is portletContextMenu.
Hence all the portlet menu items are from portletContextMenu.jsp inside themes folder.
Now to remove a particular portelt menu, look for the following code inside porteltContextMenu.jsp








You can delete the above code to remove Maximize portlet menu. Similarly other portlet menus can be removed. You can find code for portlet menus like Personalize, Edit_Default, Config, Maximize, Minimize, Help, Delete etc in portletContextMenu.jsp. Hence for removing any menu, you can just find the entry of that particular menu and can remove it.

If you have any better approach or any suggestions to improve this post, please leave a comment below.