Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

These instructions step you through the process to enable the minimize links on portlets.

Step 1

...

: Modify the content.xsl file

  1. Open content.xsl for editing (../uportal-war/src/main/resources/layout/theme/universality/content.xsl)
  2. Uncomment the areas below marked "UNCOMMENT FOR MINIMIZE CONTROL"

    No Format
    
    <xsl:if test="not(//focused) and @minimized='false'"> <!-- Focus. -->
            <!-- UNCOMMENT FOR MINIMIZE CONTROL
            <a href="{$BASE_ACTION_URL}?uP_root=root&amp;uP_tcattr=minimized&amp;minimized_channelId={@ID}&amp;minimized_{@ID}_value=true&amp;uP_save=all"
               title="{$TOKEN[@name='PORTLET_MINIMIZE_LONG_LABEL']}" class="up-portlet-control minimize">
              <span><xsl:value-of select="$TOKEN[@name='PORTLET_MINIMIZE_LABEL']"/></span>
            </a>
            -->
            <a href="{$BASE_ACTION_URL}?uP_root={@ID}" title="{$TOKEN[@name='PORTLET_MAXIMIZE_LONG_LABEL']}" class="up-portlet-control focus">
              <span><xsl:value-of select="$TOKEN[@name='PORTLET_MAXIMIZE_LABEL']"/></span>
            </a>
          </xsl:if>
          <xsl:if test="@minimized='true'"> <!-- Return from Minimized. -->
            <!-- UNCOMMENT FOR UNMINIMIZE CONTROL
            <a href="{$BASE_ACTION_URL}?uP_root=root&amp;uP_tcattr=minimized&amp;minimized_channelId={@ID}&amp;minimized_{@ID}_value=false&amp;uP_save=all"
               title="{$TOKEN[@name='PORTLET_RETURN_LONG_LABEL']}" class="up-portlet-control return">
              <span><xsl:value-of select="$TOKEN[@name='PORTLET_RETURN_LABEL']"/></span>
            </a>
            -->
          </xsl:if>
    
  3. The modifications above should now look like the following:

    No Format
    
    <xsl:if test="not(//focused) and @minimized='false'"> <!-- Focus. -->
            <a href="{$BASE_ACTION_URL}?uP_root=root&amp;uP_tcattr=minimized&amp;minimized_channelId={@ID}&amp;minimized_{@ID}_value=true&amp;uP_save=all"
               title="{$TOKEN[@name='PORTLET_MINIMIZE_LONG_LABEL']}" class="up-portlet-control minimize">
              <span><xsl:value-of select="$TOKEN[@name='PORTLET_MINIMIZE_LABEL']"/></span>
            </a>
            <a href="{$BASE_ACTION_URL}?uP_root={@ID}" title="{$TOKEN[@name='PORTLET_MAXIMIZE_LONG_LABEL']}" class="up-portlet-control focus">
              <span><xsl:value-of select="$TOKEN[@name='PORTLET_MAXIMIZE_LABEL']"/></span>
            </a>
          </xsl:if>
          <xsl:if test="@minimized='true'"> <!-- Return from Minimized. -->
            <a href="{$BASE_ACTION_URL}?uP_root=root&amp;uP_tcattr=minimized&amp;minimized_channelId={@ID}&amp;minimized_{@ID}_value=false&amp;uP_save=all"
               title="{$TOKEN[@name='PORTLET_RETURN_LONG_LABEL']}" class="up-portlet-control return">
              <span><xsl:value-of select="$TOKEN[@name='PORTLET_RETURN_LABEL']"/></span>
            </a>
          </xsl:if>
    
  4. Next, in the same file (content.xsl)  find the following code segment (around line #85)

    No Format
    
    <!-- ****** START: PORTLET CONTENT ****** -->
    <div id="portletContent_{@ID}" class="up-portlet-content-wrapper"> <!-- Portlet content container. -->
         <div class="up-portlet-content-wrapper-inner">  <!-- Inner div for additional presentation/formatting options. -->
                <xsl:copy-of select="."/> <!-- Write in the contents of the portlet. -->
         </div>
    </div>
    

    Replace with the following segment:

    No Format
    
    <!-- ****** START: PORTLET CONTENT ****** -->
    <div id="portletContent_{@ID}" class="up-portlet-content-wrapper"> <!-- Portlet content container. -->
         <div class="up-portlet-content-wrapper-inner">  <!-- Inner div for additional presentation/formatting options. -->
              <xsl:if test="@minimized != 'true'">
                  <xsl:copy-of select="."/> <!-- Write in the contents of the portlet. -->
              </xsl:if>
         </div>
    </div> 
    
  5. Finally, in the same file (content.xsl) locate another code segment (around line #110 - 113)

    No Format
    
    <!-- ****** PORTLET CONTENT ****** -->
    <div id="portletContent_{@ID}" class="fl-widget-content fl-fix up-portlet-content-wrapper"> <!-- Portlet content container. -->
         <div class="up-portlet-content-wrapper-inner">  <!-- Inner div for additional presentation/formatting options. -->
             <xsl:copy-of select="."/> <!-- Write in the contents of the portlet. -->
         </div>
    </div>
    

    Replace with the following segment:

    No Format
    
    <!-- ****** PORTLET CONTENT ****** -->
    <div id="portletContent_{@ID}" class="fl-widget-content fl-fix up-portlet-content-wrapper"> <!-- Portlet content container. -->
         <div class="up-portlet-content-wrapper-inner">  <!-- Inner div for additional presentation/formatting options. -->
            <xsl:if test="@minimized != 'true'">
                <xsl:copy-of select="."/> <!-- Write in the contents of the portlet. -->
            </xsl:if>
         </div>
    </div>
    
  • You will notice above that we are simply adding a test to determine if the portlet is/is not in a minimized state before we write in the contents of the portlet.

Step 2

...

: Deploy your changes

  • deploy your changes from your uPortal source directory
No Format

ant deploy-war

Step 3

...

: Restart Tomcat

Restart your tomcat servlet container to activate the change.

 

Info
iconfalse
titleAdditional References

...