XF 2.2 template: if does not work if $var does not exist?

Robert9

Well-known member
Code:
<xf:if is="{{$forum.node_id}}">
      do something
    <xf:else />
      do something
    </xf:if>

This works as long I have $forum;
but it does not work, when there is no forum.

How can I do an isset() in a template?
 
I can solve this by $thread.Forum.node_idm, but the question stays:

How can I do an isset() in an template?


And how can I make a difference in thread_list_macros to know, if I am in a forum or on whats new or somewhere else?
 
Back
Top Bottom