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

Fixed No error in template

Discussion in 'Resolved Bug Reports' started by bart, Oct 7, 2013.

  1. bart

    bart Active Member

    This should produce an error when saving the template:

    <xen:if is="{$forum.node_id}==27">
      <xen:include template="name1"/>
    <xen:else is="{$forum.node_id}==30"/>
      <xen:include template="name2"/>
    <xen:else is="{$forum.node_id}==32"/>
      <xen:include template="name3"/>
    As you see I did "else" instead of "elseif". Using one else does give the error. using two of them doesn't.

    it does give this error on the page:

    "Parse error: syntax error, unexpected T_ELSE in /data/www/xen/library/XenForo/Template/Abstract.php(265) : eval()'d code on line 70"
    Adam Howard and Chris D like this.
  2. digitalpoint

    digitalpoint Well-Known Member

    Just like in PHP, you can't have multiple else conditionals within a single if statement. The first one should be an elseif.
    Lawrence likes this.
  3. Mike

    Mike XenForo Developer Staff Member

    Multiple else tags are now prevented.

Share This Page