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

<xen:container var

Chris D

XenForo developer
Staff member
#1
I think I'm overlooking something.

I would like to set a variable in a template, and have it available to use in the PAGE_CONTAINER. This is usually done like this:

Code:
<xen:container var="$head.canonical"><link rel="canonical" href="{xen:link 'canonical:index'}" /></xen:container>
Then in the PAGE_CONTAINER template, the {$head} variable is available.

I'd like to do something similar, e.g.

Code:
<xen:container var="$foo.bar">1</xen:container>
But when I do, in PAGE_CONTAINER:

Code:
{xen:helper dump, $foo}
The value returned is NULL.

So clearly I'm missing something, but I can't think what.
 

Chris D

XenForo developer
Staff member
#3
That still doesn't work, unfortunately.

<xen:container var="" should be setting the contents of the var to be used in the container. But again either way, it is still NULL.
 

Chris D

XenForo developer
Staff member
#4
Update.

Courtesy of @Jake Bunce problem is my template where I was defining the container var is actually contained in the container template already.

This works fine if I use the <xen:container tags in content template or templates included by the content template.