Documentation‎ > ‎WebSphere Portal‎ > ‎

Updating Skin with Maximize and Minimize Buttons

Code Snippets

WebSphere Portal 6.1 skin comes with hidden portlet pop up menu on the right side of the title bar. When user moves cursor over this area, browser will show pop up menu to select actions such as selecting window states, changing modes. This article explains how to display buttons to maximize and minimize portlets on the title bar without using pop up menu.
  1. Portlet can display maximize icon, upon clicking it the portlet is maximized. When portlet is in maximized state, it will display restore icon which will restore the portlet to normal mode. Here is the code snippet to maximize and restore portlet. You need to place maximizeIcon.gif and restoreIcon.gif images in your skin directory for maximize and restore buttons.

    <portal-logic:if portletMaximized="no">
    <portal-skin:portletMaximize>
    <a href="<%=wpsPortletMaximizeURL%>">
    <img src='<portal-logic:urlFindInSkin file="maximizeIcon.gif" />' style="border: 0px; background-color: transparent;" title="Maximize" />
    </a>
    </portal-skin:portletMaximize>
    </portal-logic:if>


    <portal-logic:if portletMaximized="yes">
    <portal-skin:portletRestore>
    <a href="<%=wpsPortletRestoreURL%>">
    <img src='<portal-logic:urlFindInSkin file="restoreIcon.gif" />' style="border: 0px; background-color: transparent;" title="Restore" />
    </a>
    </portal-skin:portletRestore>
    </portal-logic:if>


  2. Portlet can display minimize icon, upon clicking it the portlet is minimized. When portlet is in minimized state, it will display restore icon which will restore the portlet to normal mode. Here is the code snippet to minimize and restore portlet. You need to place minimizeIcon.gif and restoreIcon.gif in your skin directory for minimize and restore buttons.

    <portal-logic:if portletState="Normal,Maximized">
    <portal-skin:portletMinimize>
    <a href="<%=wpsPortletMinimizeURL%>">
    <img src='<portal-logic:urlFindInSkin file="minimizeIcon.gif" />' style="border: 0px; background-color: transparent;" title="Minimize" />
    </a>
    </portal-skin:portletMinimize>
    </portal-logic:if>


    <portal-logic:unless portletState="Normal,Maximized">
    <portal-skin:portletRestore>
    <a href="<%=wpsPortletRestoreURL%>">
    <img src='<portal-logic:urlFindInSkin file="restoreIcon.gif" />' style="border: 0px; background-color: transparent;" title="Restore" />
    </a>
    </portal-skin:portletRestore>
    </portal-logic:unless>


Comments