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

Template including

Mythotical

Well-known member
#1
I know that:
HTML:
<xen:include template="{$block.block_template}" />
Won't work, so I remove { } but I get no return for the variable. There a specific way to make this work by using a variable from the database that has a template name?
 

CurveGotti

Active member
#2
I know that:
HTML:
<xen:include template="{$block.block_template}" />
Won't work, so I remove { } but I get no return for the variable. There a specific way to make this work by using a variable from the database that has a template name?
I think the correct method would be
HTML:
<xen:include template="block.block_template" />
no { } or $

hopefully :)
 

Mythotical

Well-known member
#3
That is correct if I was pulling a template like that but the var is replaced by a pre-determined entry in the database from a separate table.
 

CurveGotti

Active member
#4
ok I see what you mean now, no idea on that one then. I'll have to look around and see if I can find an instance anywhere, or hopefully someone else has a valid answer before we go mad looking for such an example :confused:
 

CurveGotti

Active member
#6
LOL no kidding, I have been driving myself bonkers trying to figure this out.
Code:
 <xen:include template="block_template">
            <xen:set var="$block">
</xen:set>
        </xen:include>
lol don't know if this is right either but just trying to brain storm, saw something similar in a template....
 

Mike

XenForo developer
Staff member
#9
It looks like you're trying to include a template dynamically. You can't do that. Includes are resolved at compile time.

If you want a template dynamically, you're getting into setting up a view.