Announcement

Collapse
No announcement yet.

Conditional Template

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

  • Conditional Template

    Is it possible to do something like <if usergroupid=XX> </if> ?

    Or even better <if usergroupid=XX or XX or XX> </if>

  • #2
    nope.. you can only use the conditionals in vB3. Unless you want to hack them into vb2 yourself.
    Chamber of Secrets - The Ultimate Harry Potter Community!

    Comment


    • #3
      Thats why I posted in the vb3 forum heheh

      Comment


      • #4
        sure thing

        <if condition="$bbuserinfo[usergroupid] == whateverGroup">

        your template here

        </if>

        Comment


        • #5
          Very nice

          However, if I did usergroupid == 1,5,3 would that work?

          Comment


          • #6
            No. The conditional has to be valid PHP.

            Comment


            • #7
              ...And, since not everybody in the world knows PHP, I'll actually help you -- try this:

              Code:
              <if condition="$bbuserinfo[usergroupid] == 1 || $bbuserinfo[usergroupid] == 3 || $bbuserinfo[usergroupid] == 5">
               
              <!-- Do something -->
               
              </if>
              I don't remember whether "or" or "||" is used in the templates, but either should work.

              Comment


              • #8
                Originally posted by iDavid
                ...And, since not everybody in the world knows PHP, I'll actually help you -- try this:

                Code:
                <if condition="$bbuserinfo[usergroupid] == 1 || $bbuserinfo[usergroupid] == 3 || $bbuserinfo[usergroupid] == 5">
                 
                <!-- Do something -->
                 
                </if>
                I don't remember whether "or" or "||" is used in the templates, but either should work.
                It doesn't matter, in php you can use ||, or so I think in the templates you can use ||, or also

                The devs seem to use "and, or" but I have some templates written with "&&, ||" and that's not a problem

                Comment


                • #9
                  Thanks

                  Comment

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