SEO in WebSphere Portal Page Title

0 votes

I know that you can change the page title at the portal level, but this solution doesn't offer any SEO value since it doesn't change the TITLE tag in the page.

For what I've seen the way to changing the portal titles are very static (these are global settings):

  • Changing the bannerTitleText in the theme policy
  • If that's not present adjust the bannerTitleTextResourceBundle and bannerTitleTextResourceKey to the desired value.
  • Otherwise, set the titles globally at the theme configuration

Our goal is to be able to set the title at the page level so that it can change from page to page and include the relevant page's keyword.

Actually it would be most ideal if this could be done from WCM.

Update

I noticed that the default theme in WebSphere Portal 6.1.5 was appending the page title, so examined the theme and surely enough the jspInit.jspf had some the following new methods:

private static com.ibm.portal.state.service.PortalStateManagerServiceHome portalStateManagerServiceHome;

// (This goes in the jspInit constructor)
portalStateManagerServiceHome = (com.ibm.portal.state.service.PortalStateManagerServiceHome) ctx.lookup("portal:service/state/PortalStateManager");

protected com.ibm.portal.state.service.PortalStateManagerService getStateManagerService( javax.servlet.ServletRequest request, javax.servlet.ServletResponse response ) throws Exception {
    final com.ibm.portal.state.service.PortalStateManagerService psms = portalStateManagerServiceHome.getPortalStateManagerService( (javax.servlet.http.HttpServletRequest) request, (javax.servlet.http.HttpServletResponse) response );
    return psms;
}
protected boolean isStaticPage( javax.servlet.ServletRequest request, javax.servlet.ServletResponse response ) throws com.ibm.portal.ModelException {
    final com.ibm.portal.model.NavigationSelectionModelProvider nsmProvider = navigationSelectionModelHome.getNavigationSelectionModelProvider();
    final com.ibm.portal.navigation.NavigationSelectionModel nsm = nsmProvider.getNavigationSelectionModel(request, response);
    final com.ibm.portal.navigation.NavigationNode currentNavNode = (com.ibm.portal.navigation.NavigationNode) nsm.getSelectedNode();
    final com.ibm.portal.content.ContentNode currentContentNode = currentNavNode.getContentNode();

    return currentContentNode.getContentNodeType().equals( com.ibm.portal.content.ContentNodeType.STATICPAGE );
}

protected com.ibm.portal.navigation.NavigationNode getSelectedNode( final javax.servlet.ServletRequest request, javax.servlet.ServletResponse response ) throws com.ibm.portal.ModelException {
    com.ibm.portal.model.NavigationSelectionModelProvider nsmProvider = navigationSelectionModelHome.getNavigationSelectionModelProvider();
    com.ibm.portal.navigation.NavigationSelectionModel nsm = nsmProvider.getNavigationSelectionModel(request, response);
    return (com.ibm.portal.navigation.NavigationNode) nsm.getSelectedNode();
}

protected String getSelectedNodeTitle( final javax.servlet.ServletRequest request, javax.servlet.ServletResponse response ) throws com.ibm.portal.ModelException {
    final String title;
    if ( localizedContextHome != null ) {
        com.ibm.portal.model.LocalizedContext context = localizedContextHome.getLocalizedContext( (javax.servlet.http.HttpServletRequest) request );
        title = context.getTitle( getSelectedNode( request, response ) );
    } else {
        title = "";
    }

    return title;
}

After adding this I was able to copy the head_title.jspf from the 6.1.5 theme; which includes the following new lines:

<c:set var="selectedNodeTitle" value="<%=getSelectedNodeTitle(request, response)%>" />
<title><c:out value="${siteTitle} - ${selectedNodeTitle}"/></title>

Now all that's left is figuring out a way of fetching this from WCM.

Is there a way to dynamically change the pages title at runtime?

Mar 8 in Digital Marketing by Kichu
• 16,850 points
18 views

No answer to this question. Be the first to respond.

Your answer

Your name to display (optional):
Privacy: Your email address will only be used for sending these notifications.

Related Questions In Digital Marketing

0 votes
1 answer

How to remove home page title in Yoast SEO?

Here, you have two possibilities. You can ...READ MORE

answered Mar 4 in Digital Marketing by narikkadan
• 7,860 points
88 views
0 votes
0 answers

Calling Yoast SEO title in widget not work

I just install Wordpress SEO plugin by ...READ MORE

Mar 4 in Digital Marketing by Kichu
• 16,850 points
15 views
0 votes
0 answers

Calling Yoast SEO title in widget not work

I install Wordpress SEO plugin by Yoast, ...READ MORE

Mar 6 in Digital Marketing by Kichu
• 16,850 points
30 views
0 votes
1 answer

How to over-ride meta data in Wordpress, using Squirrly SEO

if (is_archive()){ add_filter('sq_title', 'filter_product_wpseo_metadesc'); function filter_product_wpseo_metadesc($wpseo_metadesc){ ...READ MORE

answered Mar 1 in Digital Marketing by narikkadan
• 7,860 points
37 views
0 votes
0 answers

SEO: Why "indexed pages" in Webmaster Tools and the command "site:" gives so much difference?

"Indexed URLs: 305,509"webmaser shows this when i ...READ MORE

Mar 2 in Digital Marketing by Kichu
• 16,850 points
22 views
0 votes
0 answers

WP All in one SEO, does it have a database?

I am using wordpress for my website ...READ MORE

Mar 2 in Digital Marketing by Kichu
• 16,850 points
23 views
0 votes
3 answers

Is SEO a bad choice as a long-term career?

Take up digital marketing instead of just ...READ MORE

answered Sep 10, 2019 in Career Counselling by Tanya
531 views
+2 votes
2 answers

Is Reactjs SEO friendly? with google bots

Yes, with SERVER-SIDE RENDERING you will not face ...READ MORE

answered Feb 10 in Others by Shreesh
• 160 points
89 views
0 votes
1 answer

What are canonical URLs and how do they affect your SEO?

canonical URLs are distinct URL used to ...READ MORE

answered Feb 11 in Others by narikkadan
• 7,860 points
31 views
0 votes
1 answer

What are the important meta tags I must put in my website? [closed]

Regular meta info <title>{{pageTitle}}</title> <meta charset="utf-8"><!-- html5 version ...READ MORE

answered Feb 11 in Others by narikkadan
• 7,860 points
22 views
webinar REGISTER FOR FREE WEBINAR X
Send OTP
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP