Template including

Mythotical

Well-known member
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
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
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
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
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....
 

Mythotical

Well-known member
Gave that a whirl but something is preventing it. I'll do a var dump to make sure its actually pulling it.
 

Mike

XenForo developer
Staff member
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.
 

Mythotical

Well-known member
Ok so guess I can look at the template.php file for a determination of doing this then. Thanks Mike as usual. hehe
 
Top