threadloom
Well-known member
Hi,
I'm trying to set a variable in an XF1 template to the result of some nested ternaries. I have it working in XF2, but can't get it to work in XF1.
Here's what I have:
But it's not resolving that variable to the result of the ternary, it's resolving it to the string literal: {{ $forum.node_id ? $forum.node_id : ($thread.node_id ? $thread.node_id : -1) }}
I've tried single and double brackets, but still no luck. Maybe something screwy with my syntax?
Thanks in advance for the help.
Paul
PS. I also tried
with single and double brackets, but still no luck.
I'm trying to set a variable in an XF1 template to the result of some nested ternaries. I have it working in XF2, but can't get it to work in XF1.
Here's what I have:
Code:
<xen:set var="$nodePart">{{ $forum.node_id ? $forum.node_id : ($thread.node_id ? $thread.node_id : -1) }}</xen:set>
But it's not resolving that variable to the result of the ternary, it's resolving it to the string literal: {{ $forum.node_id ? $forum.node_id : ($thread.node_id ? $thread.node_id : -1) }}
I've tried single and double brackets, but still no luck. Maybe something screwy with my syntax?
Thanks in advance for the help.
Paul
PS. I also tried
Code:
$forum.node_id || $thread.node_id || -1