Create custom links to portlets and pages

URLs encode navigational state information about WebSphere Portal (for example, the user's currently selected page) and about the portlets on a page (for example, the window state of the portlet) in a serialized form. Encoding navigational state information in the URL is used by the portal server to support use of the browser's back button.

You can create URLs to the following target resources.


Notes:

Quick Links can also be used to access major areas of the site. Quick Links are also accessible from any location within the site, and you can customize them. Quick Links are displayed at the bottom of the site and can be customized as well as provide one-click access to major areas of the site. Refer to the Adding a Quick Link section of this topic for more information.


Create a URL to a portlet

The <portal-navigation:urlGeneration/> tag can be used together with <portal-navigation:urlParam/> to pass parameters to a portlet. In the following example, the <portal-navigation:urlParam/> tag is used to send render parameters to a standard portlet. The parameters specified by <portal-navigation:urlParam/> tags can be read by the targeted portlet by calling the getParameter() method on the portlet request.

<portal-navigation:urlGeneration contentNode="ibm.portal.WebSphere Portal.Welcome" 
                         layoutNode="welcome.bookmarks"
                         portletWindowState="Maximized" accessControlCheck="NoCheck">
    
   <portal-navigation:urlParam name="<%= month %>" value="August" type="render" />
   <portal-navigation:urlParam name="<%= day %>"   value="Monday"  type="render" />
   <portal-navigation:urlParam name="<%= amount %>" value="<%= ACCOUNT_BALANCE %>"  type="render" />
    
   <a href="<% wpsURL.write(out); %>" class="wpsLinkBarLink">
      <portal-fmt:text key="link.bookmarkstitle" bundle="nls.myproperties"/>
   </a>
    
</portal-navigation:urlGeneration>
    

To target the action phase on a standard portlet, you need to also include the portletParameterType attribute on the <portal-navigation:urlGeneration/> tag, as in the following example.

<portal-navigation:urlGeneration contentNode="sample.page" 
                      layoutNode="sample.portlet" portletParameterType="action">
   <portal-navigation:urlParam name="key" value="value"/>
   <a href="<% wpsURL.write(out); %>">
      // simple action with param
   </a>
</portal-navigation:urlGeneration>
To target the action phase of an IBM portlet, use the actionName attribute, which is described in <portal-navigation/> tags.

The following example is used in the drop-down list in the toolbar to generate a URL to the Organize Favorites portlet. The noCheck value indicates that the user's access control is not checked prior to generating the tag content.

      <portal-navigation:urlGeneration contentNode="wps.Organize Favorites" 
                         portletWindowState="Normal" pacCheck="NoCheck">
         <option value='<% wpsURL.write(out); %>' >
         <portal-fmt:text key='link.favorites.orgainize' bundle='nls.engine'/>
      </portal-navigation:urlGeneration>
      
      


Create a URL to a page

The following steps show how to add a custom page link in one of the theme JSPs. The link opens a page using its custom unique name. The steps use a page with the custom unique name of yourCo.MyAccountsPage.

  1. Use Manage Pages to create a new page, for example, My Account.

  2. Go to Administration, then Portal Settings, then Custom Unique Names.

  3. Find the page titled "My Account". You can use the search function or page through until you find it.

  4. Assign a unique name for this portlet, for example, yourCo.MyAccountsPage.

  5. Add a link in one of theme JSPs as follows:

          <portal-logic:if loggedIn="yes" portletSolo="no">
             <portal-navigation:urlGeneration contentNode="yourCo.MyAccountsPage">
                <td class="wpsToolBar" valign="middle" align="<%=bidiAlignRight%>" nowrap>
                   <a href="<% wpsURL.write(out); %>" class="wpsToolBarLink">
                       My Account
                   </a>
                </td>
             </portal-navigation:urlGeneration>
          </portal-logic:if>
      
      
      

      • The contentNode attribute specifies the unique name for the node.

      • <portal-logic:if/> tag is used to verify that the user is logged in and the navigation is intended to be displayed.

      • <% wpsURL.write(out); %> is used to add the generated URL to the HREF attribute of the link.


Generating relative URLs

Including navigational state information in the URL results in longer URLs. A large number of URLs on a page, from the themes, skins, and portlets, can make the markup for the page unwieldy and difficult to manage. Generating relative URLs can help manage the size of URLs and overall markup on a page. This section describes how relative URLs are generated and considerations for applying them.
Background on URL formats


Handling of URL formats in WebSphere Portal


Controlling the generation of relative URLs


Manage incompatibilities with relative URL generation


Add a Quick Link

Quick Links are used to access major areas of the site. Quick Links are accessible from any location within the site and you can customize them. Quick Links are displayed at the bottom of the site and can be customized as well as provide one-click access to major areas of the site. To add a Quick Link to page, use the following instructions:

  1. Select Administration.

  2. Expand the Portal User Interface section.

  3. Select Manage Pages.

  4. Search for "Quick Links" using Title starts with.

  5. Select the Quick Links page.

  6. Select the New URL tab.

  7. Complete the URL and any additional information for the Quick Link you want to add.

  8. Select OK.


Parent

Work with portal navigation

 


+

Search Tips   |   Advanced Search