XF 2.1 Dropping the site name from forum list

I think I understand what you mean, and I found it annoying. I think you're saying that you want "X Forum - X Forum" out of the title because it's redundant, and if you also use "X Forum" as the Board Title, it carries over to other areas of your site which may not be a forum (i.e., a CMS, or a blog). Therefore, I set my Board Title as above by @svaughn114 to "Site.com" instead to have "X Forum - Site.com" and "X Blog - Site.com" for the title tags, while retaining the Board Title on the forum to be "X Forum".

Find this in the template PAGE_CONTAINER
Code:
<xf:set var="$description"><xf:description /></xf:set>
And below it, you're going to want to place this:

Code:
    <xf:comment>This will change the board title H1 tag on the forum index to "X Forum"</xf:comment>
    <xf:if is="{$template} == 'forum_list'">
        <xf:set var="$h1">X Forum</xf:set>
    </xf:if>

    <xf:comment>This will change the title tag on the forum to "X Forum" plus the board title as set.</xf:comment>
    <xf:if is="{$template} == 'forum_list'">
        <title>X Forum - {$xf.options.boardTitle}</title>
    <xf:else />
        <title><xf:title formatter="%s - %s" fallback="{$xf.options.boardTitle}" page="{$pageNumber}" /></title>
    </xf:if>

Replace X Forum with your site's name. As put, this will be: "X Forum - YOUR_BOARD_TITLE_IN_ACP" and on other pages, such as the Members page, "Notable members - YOUR_BOARD_TITLE_IN_ACP". As stated, my board title in ACP is "Site.com" so it would appear as "X Forum - Site.com" and "Notable members - Site.com" respectively.
 
Last edited:
If you want it completely gone like the link to the XF1 example,
Code:
    <xf:if is="{$template} == 'forum_list'">
        <xf:set var="$h1"></xf:set>
    </xf:if>
This should do in the same place.
 
Well. It was really this simple: Line 1 of the forum_list template, where it has:
Code:
<xf:h1>{$xf.options.boardTitle}</xf:h1>

Change it to:
Code:
<xf:h1></xf:h1>

And it does what I need. BUT...

I fear that on upgrade, this reverts?
 
Interestingly, upon experimentation I find you can put anything there you want, like:

Code:
<xf:h1>Hello World</xf:h1>

But you can't just delete line 1.
That should be due to having a fallback in PAGE_CONTAINER
Code:
<xf:set var="$h1"><xf:h1 fallback="{$siteName}" /></xf:set>
I think that means is if h1 isn't defined anywhere, it's automatically going to fall back to the board title. Therefore, you need to make it null by deleting "Hello World" as in your first example.
 
I think that means is if $h1 isn't defined anywhere, it's automatically going to fall back to the board title. Therefore, you need to make it null by deleting "Hello World" as in your first example.
You're right, without the <h1> it "knows" to default. But when you put in "Hello World" that's what displays, and also in the font weight and color it's called.
 
Top Bottom