Forum Discussion

cblown's avatar
cblown
Boss
11 years ago

Including Board name within <title> on Forum Topic Page

Sorry if this has been answered elsewhere, no luck searching.

 

At the Board level the <title> element includes the Board name and the Community title based on this general format page.head.title = {0} {1} {2}  however when you move to the Forum Topic Page the board name is not included within the <title> element. 

 

I'm aware of using Text Keys to modify the <title> element format e.g. page.ForumTopicPage.page-head-title.format = {1,choice,1#{0}|1<{0} - Page {1,number,integer}} although there is limited documenation on this text keys syntax.

 

From an SEO perspective having the board name in the title elements makes a lot of sense because titles like 

I love my new runners - The Big Shoe Community 

compared to 

I love my new runners - Nike - The Big Shoe Community

greatly improves relevant keyword indexing by the search engine

 

I don't think overriding the text keys here will help as we need to do this globally? Are there any special {X} variables that can be added to the string above to add the board name?

 

Thanks

 

9 Replies

  • DougS's avatar
    DougS
    Khoros Oracle
    11 years ago

    Hi Chris,

     

    It was great to finally meet you at LiNC this year!

     

    By default the ForumTopicPage should include the board title.  Here is a description of the server-side logic that fills the the page.head.title text key arguments :

     

    1. It checks a back-end setting (named config.prefix_title) that Lithium can set to add a prefix (however I'm not sure why it would be needed).  I think this used to be settable through our old admin, but I don't see it in our current admin and I know we removed a lot of settings (that were deemed not useful or rarely used) from the latest admin.  If that setting is set, it either passes the value as the first argument of the page.head.title text key, or if a separator charcter (which is the value of the title.head.text_seperator text key) is set, it combines it with a separator character (it combines them together using the page.head_value_separated.title text key, which defaults to {0} {1} ) and passes that as the first argument of the page.head.title text key.

       

    2. Next it takes a page-specific argument (which for the ForumTopicPage is the board title) and a separator character (which is the value of the title.head.text_seperator text key) and passes them as arguments to the page.head_value_separated.title text key.  The default value for the text key is {0} {1} , but if that is changed to blank then those arguments will not be passed in and you will get a blank value (so for the ForumTopicPage you won't get the board title).  It passes the combined value as the second argument to the page.head.title text key.

       

    3. It passes the community title as the third argument to the page.head.title text key.

     

    I hope that helps you debug the problem.  Feel free to reach out to me via PM if you want me to look at how the page title is being set for the ForumTopicPage for a specific community.

     

    -Doug

  • cblown's avatar
    cblown
    Boss
    11 years ago

    Sorry for the late reply and thanks for the explanation. Although you say "By default the ForumTopicPage should include the board title." 

     

    This is not our experience, looking at half a dozen Lithium Communities I have yet to find one which does include the board name within the <title> element on the ForumTopicPage. If this was the case, on this very page the <title> would be 

     

    <title> Re: Including Board name within &lt;title&gt; on Forum T... - Developers Discussion - Lithium Community</title>

    yet its

     

    <title> Re: Including Board name within &lt;title&gt; on Forum T... - Lithium Community</title>

     

    I've actually viewed short topic headings as I thought perhaps it was being truncated, but no change.

     

    This actually seems to be the default Lithium behaviour? 

     

  • DougS's avatar
    DougS
    Khoros Oracle
    11 years ago

    Sorry for the late response (was away last week and missed your post from 3 weeks ago).  What is the value you have for the page.head_value_separated.title text key?

  • DougS's avatar
    DougS
    Khoros Oracle
    11 years ago

    I reviewed the code again and it looks like the ForumTopicPage sets an override that uses the message topic instead of the board name.  Sorry for the confusion.

  • cblown's avatar
    cblown
    Boss
    11 years ago

    So back to my original question given the tools available to us are we able to add the board name?

  • DougS's avatar
    DougS
    Khoros Oracle
    11 years ago

    It looks like there is currently no way to get the board name into the <title> tag when the ForumTopicPage loads.  You could change the <title> tag after the page loads, via javascript, but that wouldn't help with SEO since most crawlers just take what the <title> is when the page loads.

  • mpotterf's avatar
    mpotterf
    Guide
    11 years ago

    Hey Doug,

     

    Is it possible to use the category name in this manner?