jca
Member
I'm trying to add the Forum (Node) Name to the <title> tag of a page when viewing a thread in a Xenforo forum.
For example, if you are looking at a thread called "Spider-Man No Way Home" in the forum called Movie Discussion, the title of the page would be: "Spider-Man No Way Home Movie Discussion | Site Name" (with subsequent page numbers also included, such as "Spider-Man No Way Home Movie Discussion | Page 2 | Site Name" and so on).
So I believe you would edit the PAGE_CONTAINER template, and edit the <title> tag. I have the Forum Node Name working on it's own, which would look like this:
but I'm having trouble integrating it with my existing template's <title> tag, which is modified from the default:
I seem to be making a mistake trying to integrate the node title as another xf:elseif and also using the xf:title formatter and/or {pageNumber} elements -- I get syntax errors for the "ifs" and so on.
Can anyone help me with this custom <title> tag?
Appreciate any help/info.
For example, if you are looking at a thread called "Spider-Man No Way Home" in the forum called Movie Discussion, the title of the page would be: "Spider-Man No Way Home Movie Discussion | Site Name" (with subsequent page numbers also included, such as "Spider-Man No Way Home Movie Discussion | Page 2 | Site Name" and so on).
So I believe you would edit the PAGE_CONTAINER template, and edit the <title> tag. I have the Forum Node Name working on it's own, which would look like this:
Code:
<xf:if is="$template == 'thread_view'">{$forum.Node.title}</xf:if>
but I'm having trouble integrating it with my existing template's <title> tag, which is modified from the default:
Code:
<title><xf:if is="$template == 'cinvin_home_view'">{$xf.options.boardTitle} - {$xf.options.boardDescription}<xf:elseif is="$template == 'forum_list'" />Forums | {$xf.options.boardTitle}<xf:else /><xf:title formatter="%s | %s" fallback="{$xf.options.boardTitle}" page="{$pageNumber}" /></xf:if></title>
I seem to be making a mistake trying to integrate the node title as another xf:elseif and also using the xf:title formatter and/or {pageNumber} elements -- I get syntax errors for the "ifs" and so on.
Can anyone help me with this custom <title> tag?
Appreciate any help/info.