kirsty
Member
I've got
and then I extend that in
which works fine.
But actually I only want to replace things conditionally. This will replace it only if the condition is met, but otherwise it'll be blank.
What I actually want is 'original stuff' to appear if the
This version where I've put the condition outside doesn't do anything, I just get 'replacement stuff' whatever, which makes sense.
Is there a way I can get this to work? Perhaps some way to get the 'original stuff' value from 'template_a' in the extended template to put in an else clause? I don't want to put all the logic in 'template_a' as I want to extend it in several different ways and change the 'replacement stuff' in each of them.
template_a
with an extension in it
Code:
<xf:extension name='extension_name'>
original stuff
</xf:extension>
and then I extend that in
template_b
Code:
<xf:extends template='template_a'>
<xf:extension name='extension_name'>
replacement stuff
</xf:extension>
which works fine.
But actually I only want to replace things conditionally. This will replace it only if the condition is met, but otherwise it'll be blank.
Code:
<xf:extends template='template_a'>
<xf:extension name='extension_name'>
<xf:if is="$variable is not empty">
replacement stuff
</xf:if>
</xf:extension>
What I actually want is 'original stuff' to appear if the
variable
isn't set. This version where I've put the condition outside doesn't do anything, I just get 'replacement stuff' whatever, which makes sense.
Code:
<xf:extends template='template_a'>
<xf:if is="$variable is not empty">
<xf:extension name='extension_name'>
replacement stuff
</xf:extension>
</xf:if>
Is there a way I can get this to work? Perhaps some way to get the 'original stuff' value from 'template_a' in the extended template to put in an else clause? I don't want to put all the logic in 'template_a' as I want to extend it in several different ways and change the 'replacement stuff' in each of them.