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

xen:if is this template..display this template

EQnoble

Well-known member
#1
I was wondering if there is a simple way to specify a scenario such as this below...I am sure I wrote this all sort's of wrong but that's why I am asking.

<div class="{xen:if "{$templateName} == 'account_signature' then display template_Y

Anyone have any ideas?
If I would have to add this kind of functionality into a listener I am not against that at all either.
 

EQnoble

Well-known member
#2
Figured it out....
Code:
<xen:if is="{$selectedKey} == 'account/signature'">

    <div class=>Some content</div>

</xen:if>
I should add that this does not do what I thought I was going to have to do...but I have gotten the same effect out of this that I was looking for.
 

Kier

XenForo Developer
Staff member
#3
Maybe I'm reading it wrong, but there seems to be two questions here, so I'll answer both and see if we get to the resolution:
Q1:
HTML:
<div class="{xen:if '{$templateName} == "account_signature"', 'sigClass', 'otherClass'}">
Q2:
HTML:
<xen:if is="{$selectedKey} == 'account/signature'">
	<xen:include template="my_account_signature_extra_template" />
</xen:if>
 

EQnoble

Well-known member
#4
Well the problem with Q2 is that I am creating the template from a listener which listens for account_wrapper_content so the content in Q2 is actually already being called.

Also I am a little confused about the 'sigClass', 'otherClass' part

Can I use xen:if conditionals inside of my listener?
 

Kier

XenForo Developer
Staff member
#5
Well the problem with Q2 is that I am creating the template from a listener which listens for account_wrapper_content so the content in Q2 is actually already being called.

Also I am a little confused about the 'sigClass', 'otherClass' part

Can I use xen:if conditionals inside of my listener?
Generally speaking, {$varname} in a template is equivalent to $params = $template->getParams(); $varname = $params['varname'] in your template listener.