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

How to change <title> tag for home page only?

#1
I know this is probably a stupid question, but honestly, I've looked around and couldn't find much. I'm running the newest stable version and using the default theme. In the search engines, my home page title shows up as just the forum name and I'd like to add a tagline to the <title> tag to make it stand out more.

What is the best way to do that?

Thanks!
 
#2
I added the following to the forums list:

<xen:title>Forum Name - Tagline</xen:title>

It worked, but it put the forum name at the end, like:

Forum Name - Tagline | Forum Name

I want it to be:

Forum Name - Tagline
 

CTXMedia

Formerly CyclingTribe
#4
If you want a different title for the forums list "home" page - edit the PAGE_CONTAINER template and change the title coding from:

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

Code:
<xen:if is="{$contentTemplate} == 'forum_list'">
    <title>CUSTOM TITLE HERE</title>
<xen:else />
    <title><xen:if is="{$title}">{xen:raw $title} | {$xenOptions.boardTitle}<xen:else />{$xenOptions.boardTitle}</xen:if></title>
</xen:if>
Then add your custom title in the highlighted section.

Cheers,
Shaun :D
 
#6
If you want a different title for the forums list "home" page - edit the PAGE_CONTAINER template and change the title coding from:

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

Code:
<xen:if is="{$contentTemplate} == 'forum_list'">
    <title>CUSTOM TITLE HERE</title>
<xen:else />
    <title><xen:if is="{$title}">{xen:raw $title} | {$xenOptions.boardTitle}<xen:else />{$xenOptions.boardTitle}</xen:if></title>
</xen:if>
Then add your custom title in the highlighted section.

Cheers,
Shaun :D
Old post but the method works just the same. Thank you
 

ibrian

Well-known member
#7
If you want a different title for the forums list "home" page - edit the PAGE_CONTAINER template and change the title coding from:

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

Code:
<xen:if is="{$contentTemplate} == 'forum_list'">
    <title>CUSTOM TITLE HERE</title>
<xen:else />
    <title><xen:if is="{$title}">{xen:raw $title} | {$xenOptions.boardTitle}<xen:else />{$xenOptions.boardTitle}</xen:if></title>
</xen:if>
Then add your custom title in the highlighted section.

Cheers,
Shaun :D
Excellent - exactly what I was looking for. :)
 

CyberAP

Well-known member
#8
There is a better way to do it IMO:

We set a new condition for title element:

Code:
    <title>
        <xen:if is="{$customTitle}">{xen:raw $customTitle}
        <xen:elseif is="{$title}" />{xen:raw $title} | {$xenOptions.boardTitle}
        <xen:else />{$xenOptions.boardTitle}</xen:if>
    </title>
In our content template we can use <xen:container> to set a custom title instead. So it'll be like this:

Code:
<xen:container var="$customTitle">My custom title</xen:container>
Don't forget to place it before <xen:title> tag.