How to Set the Title of a WebSphere Portal Page from WCM Content Title

The JSR 286 Web Content Viewer portlet can set your overall portal page title based on the title of the content item it’s displaying. Because the portlet can literally change the title element in the HTML head, it can provide you with some benefits. Here are just a few that come to mind, for example:

  • It affect the title that shows in the browser title bar (e.g. something more meaningful than “IBM WebSphere Portal – Home – Mozilla Firefox”).
  • Similarly, it affects the title shown in a browser tab when multiple tabs are used.
  • It exposes the content item title to search engines such as Google, which may be crawling the portal. This can, of course, play a significant role in Search Engine Optimization (SEO) and the effectiveness of search results.

I wasn’t even aware of this feature until the requirement was thrown on me recently. So, if you’re in the same boat, here’s your paddle:

First you want to Edit the Shared Settings on an instance of the Web Content Viewer (JSR 286) that’s deployed on a portal page as shown below:

In the Web Content Viewer portlet, find the Portlet Settings section and set the option for ‘Page Display Title’ to ‘Select from content’ as shown below.

Apply these changes and give it a test by navigating to the portal page upon which that Web Content Viewer was deployed. Take a look at the title displayed in the browser window, browser tab, or in the HEAD section of the page’s HTML source. There, you should now see the title of the WCM content item that’s currently displayed by the portlet.

Sweet.

This entry was posted in IBM Web Content Manager. Bookmark the permalink.
  • Savas Duvan

    Thanks Cody!

    Indeed a great feature!

    What wonder what would happen in case of multiple JSR portlets doing the same? How is that handled.

    Savas Duvan

    • http://www.codyburleson.com/ Cody Burleson

      Great question. I had the same thought. My guess is that the last JSR 286 portlet on the page using the feature wins. Probably, they all set the title, but the last JSR would win because it would be the last to set the same attribute.

      • Mohammad Mahdavipour

        There is an easy way to handle multiple JSR portlets on the same page each using thier own CM Content Title. Assume there is 3 JSR portlets representing News, Events, and ‘Company’.

        First you need to create a copy of the JSR portlet and give it a unique name. For the above scenario you need to create 3 copies.Add the portlets to the page and Edit the Shared Settings on any specific instance of the Web Content Viewer (JSR 286) (News, Events, Company) that’s deployed on a portal page.