!= false

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • UnknownServices
    New Member
    • Jan 2005
    • 21

    != false

    I"m using the fowlloing in my footer template:

    Code:
    <if condition="$show['sidebar'] != false">
     <!-- Sidebar -->
     <!-- Update -->
     		</td>
     	</tr>
     </table>
     <!-- /Update -->
     		</td>
     	</tr>
     </table>
     <!-- /Sidebar -->
     </if>
    I want to know why the condition statment isn't working. In the file that I don't want that to show in the footer I put this
    $show['sidebar'] = false;
    but I don't know why its not working.
  • manguish
    Senior Member
    • Jan 2004
    • 361

    #2
    Use :

    <if condition="!show['sidebar']">blahba;h</if>
    Last edited by manguish; Wed 5 Jan '05, 3:00pm.
    For all your minimoto needs : www.minimotoclub.com

    Comment

    • Zachery
      Former vBulletin Support
      • Jul 2002
      • 59097

      #3
      you cant add php directly to the files, and by default there is no $show['sidebar'] varible.

      Comment

      • UnknownServices
        New Member
        • Jan 2005
        • 21

        #4
        How do I create the variable? I'm not adding it to the file, I added $show['sidebar'] = false; to the a .php file.

        Comment

        • Floris
          Senior Member
          • Dec 2001
          • 37767

          #5
          Sorry, we don't support custom code.

          The conditional for the template is correct:

          <if condition="!show['sidebar']">yourcode</if>
          meaning if the variable is empty .. it will show yourcode.

          Comment

          • UnknownServices
            New Member
            • Jan 2005
            • 21

            #6
            So if I put show['sidebar']=false; it will not show, but if it isn't defined it will show?

            Comment

            • Floris
              Senior Member
              • Dec 2001
              • 37767

              #7
              No.

              show['sidebar'] should be $show['sidebar']

              and the = makes it a 'set this variable value to x' rather then == which means 'the value is is equal to what i match it against'

              If you set it to 'false' in your php code, you should use:

              <if condition="$show['sidebar'] == 'false'">sidebar is false</if>

              and if you don't want it to match

              <if condition="$show['sidebar'] != 'false'">sidebar is not false but has another value</if>

              Comment

              • UnknownServices
                New Member
                • Jan 2005
                • 21

                #8
                Ok thanks for that. Do I have to create the varaible or is it created when I set it, if so where would I create it?

                Comment

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