1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

XF 1.2 Meta title of a thread

Discussion in 'XenForo Questions and Support' started by Alexey.P, Aug 16, 2013.

  1. Alexey.P

    Alexey.P Member


    I have noticed that on my forum (even in here at Xenforo Community forum) the same meta title is every where, not only the homepage of the forum..

    Even while creating the thread it is with home page meta title:
    <title>Create Thread | XenForo Community</title>

    My question is,
    How is it possible to keep this only at the forum homepage and in the threads/conversations or in fact any where else -> without it?

    1. Xenforo with the homepage title inside a thread:
    <title>1.2 - Template Modifications and Comparison | XenForo Community</title>

    2. DigitalPoint without the homepage title inside a thread:
    <title>Bing Vs. Google?</title>

    Same on

    And others..

    I only want to have the thread title in the page meta title...
  2. Jeremy

    Jeremy Well-Known Member

    Edit it out of the <title> attribute in (I believe) the PAGE_CONTAINER template. If you want it on the homepage, modify the <xen:title> tag and add it back in on the forum_list template.
  3. Alexey.P

    Alexey.P Member

    What do you mean if I want it on the homepage, want what?

    This is what I see on PAGE_CONTAINER:
    <title><xen:if is="{$title}">{xen:raw $title} | {$xenOptions.boardTitle}<xen:else />{$xenOptions.boardTitle}</xen:if></title>

    I tried to keep it:

    <title><xen:if is="{$title}">{xen:raw $title} </title>

    And I get an error:
    The following templates contained errors and were not saved: PAGE_CONTAINER: 1) Line 42: Template syntax error.
  4. Jeremy

    Jeremy Well-Known Member

    Change it to this:
    <title><xen:if is="{$title}">{xen:raw $title}<xen:else />{$xenOptions.boardTitle}</xen:if></title>
    That is set via the <xen:title> tag (documentation linked in my previous post). Actually, you may not need to set it on the forum home, its probably already done like that.

    And you can't leave an unclosed <xen:if> tag in your template.
    fionix likes this.
  5. Alexey.P

    Alexey.P Member

    So some thing like that:

    <title><xen:if is="{$title}">{xen:raw $title}<xen:else />{$xenOptions.boardTitle}</xen:if></title> ?

    How can I keep the homepage meta title at forum/node pages? (not threads).
  6. Jeremy

    Jeremy Well-Known Member

    I'm not sure what you are asking?

    The code I provided will remove " | XenForo Community" from all pages unless no specific page title is defined, and then it replaces it with "XenForo Community".
  7. Alexey.P

    Alexey.P Member

    I meant in the forum it self, for example:
    <title>XenForo Questions and Support | XenForo Community</title>

    After editing the PAGE_CONTAINER it will remove the " | XenForo Community", but I do want to keep it inside the forums it self (just not the threads).
  8. Jeremy

    Jeremy Well-Known Member

    Edit forum_view (I believe that is the name) and add:
     | {$xenOptions.boardTitle}
    into the <xen:title> tag and it should work.
    Alexey.P likes this.
  9. Alexey.P

    Alexey.P Member

    It worked.
    Thanks a lot King :)
  10. fionix

    fionix Active Member

    This works great and was exact what I was looking for too :) Is there any chance this can be put in the EXTRA.CSS so we don't have to edit this on forum update? if so, how can this be done.
  11. Brogan

    Brogan XenForo Moderator Staff Member

    You can't use HTML code in CSS templates.

    You won't necessarily have to edit the template again when upgrading - if it is outdated, you will have the option to merge, which should handle it automatically.

Share This Page