XF 2.2 How to fill a breadcrumb variable into page title in threads

CTS

Active member
(I have another thread here but please ignore it. Poorly crafted thread and a mess of ideas. Focused here now)

Goal: To extract and use second level breadcrumb text to append to the beginning of the page meta title contents ( <title>contents</title> ) of a thread view, located in the PAGE_CONTAINER template. This when thread is displayed and a second level breadcrumb exists.

PAGE_CONTAINER template:
From:
Code:
<title><xf:title formatter="%s | %s" fallback="{$xf.options.boardTitle}" page="{$pageNumber}" /></title>

To:
Code:
<title><xf:include template="addtometatitle" /><xf:title formatter="%s | %s" fallback="{$xf.options.boardTitle}" page="{$pageNumber}" /></title>

Then I created a template called: addtometatitle

Now I know this works so far because I can add plain text and it successfully displays in the browser tab.

So I added this in the new addtometatitle template:
Code:
    <xf:if is="$breadcrumbs && count($breadcrumbs) > 2">
        {xen:helper threadPrefix, $breadcrumbs[2]}
          <xf:if is="{$xenOptions.boardTitle}" title="true">- {$xenOptions.boardTitle}</xf:if>
    </xf:if>


Now, the output I get on the browser tab is: (when conditional met)
{xen:helper threadPrefix, $breadcrumbs[2]}
The literal code text

I have tried different ways, and even solicited ChatGTP for assistance, but I am stuck on how to make the breadcrumb text actually show.

Any thoughts greatly appreciated.

final edit
 
Last edited:
Doing a bit of reading here, and I realize that I have to find a way to pass the breadcrumb values to the page container.

Havent used XF since the pre v2 days and I am back on a learning curve.
 
Top Bottom