Announcement

Collapse
No announcement yet.

Help with nested conditionals

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • [Forum] Help with nested conditionals

    Trying to edit the Forumdisplay template to re-direct the New Thread buttons to custom forms but running into a Invalid Tag Nesting error.

    Code:
    <vb:if condition="$show['newthreadlink']">
        <vb:if condition="in_array($forum['forumid'], array(102,110))">
             1st condition
        </vb:if>
    </vb:if>
    help?

    Putting just those 4 lines into a new template also gives the error.

  • #2
    <vb:if condition="$show['newthreadlink'] AND in_array($forum['forumid'], array(102,110))">
    1st condition
    </vb:if>

    Something like this, just as a sample, chances are high that it doesn't work.
    .......

    Comment


    • #3
      Managed to get it working.

      The intent was to do the following :-

      Code:
       <vb:if condition="$show['newthreadlink']">
          <vb:if condition="in_array($forumid, array(1,3,5,7))">
              condition 1 result
          <vb:elseif condition="in_array($forumid, array(2,4,6,8))" />
              condition 2 result
          <vb:else />
              condition 3 result
          </vb:if>
      </vb:if>
      And the above works now. Another mistake I made was to call <vb:raw var> from inside an IF statement which I believe is not allowed.

      Comment

      widgetinstance 262 (Related Topics) skipped due to lack of content & hide_module_if_empty option.
      Working...
      X