XF 2.3 How do I add the forum name to thread titles?

Stuart Wright

Well-known member
Licensed customer
ChatGPT (confidently) told me to add this in to PAGE_CONTAINER
Code:
<xf:if is="$template == 'thread_view' && $forum">
    <xf:title><xf:title /> | {$forum.Node.title}</xf:title>
</xf:if>
before
Code:
<title><xf:title formatter="%s | %s" fallback="{$xf.options.boardTitle}" page="{$pageNumber}" /></title>
but annoyingly and predictably, it doesn't change anything.
How do I add the forum name to thread titles please?
Thanks
 
How do I add the forum name to thread titles please?
Do you want to add it on thread view? If that is a yes, find this code: at the thread_view template

HTML:
<xf:h1>{{ prefix('thread', $thread) }}{$thread.title}</xf:h1>

And replace it with this:

HTML:
<xf:h1>{{ prefix('thread', $thread) }}{$thread.title} - {$thread.Forum.Node.title}</xf:h1>

That will add the forum title at the end of the thread titles. Hope it helps.
 
I should have been specific. It's the meta title that I want to change. Not the H1 displayed title.
It has to be a change to PAGE_CONTAINER, right?
Still at the same template the very first line:

HTML:
<xf:title page="{$page}">{{ prefix('thread', $thread, 'escaped') }}{$thread.title}</xf:title>

And add $thread.Forum.Node.title} before or after {$thread.title} depending on how you want to add it.
 
Back
Top Bottom