We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 36575
    • 104 Posts
    Hi,

    I would like to use the If snippet to check if a checkbox has been ticked on the template, and if so, display a chunk with a dropdown selector.

    I am trying this:

    [[!If
    &subject=`[[*widefit]]`
    &operator=`=`
    &operand=`yes`
    &then=`[[$dropselectorwide]]`
    &else=``
    ]]

    My TV widefit is input type: checkbox, input option values yes, output type default.
    Dropselectorwide is a chunk with the following code:

    <label class="label_left">Normal or Wide fit?</label>
    <select size="1" class="itemselect" name="normalorwide">
    <option value="Normal Fit">Normal Fit</option>
    <option value="Wide Fit">Wide Fit</option>
    </select>

    Any ideas what i am doing wrong in the if call?

    thanks,
    Rachel
      • 6228
      • 249 Posts
      Have you tried something like:

      [[*widefit:is=``:then=``:else=`[[$dropselectorwide]]`]]
        lo9on.com

        MODx Evolution/Revolution | Remote Desktop Training | Development
        • 4172
        • 5,888 Posts
        you forgot the ’?’ after If

        [[!If?
           &subject=`[[*widefit]]`
           &operator=`=`
           &operand=`yes`
           &then=`[[$dropselectorwide]]`
           &else=``
        ]]
          -------------------------------

          you can buy me a beer, if you like MIGX

          http://webcmsolutions.de/migx.html

          Thanks!
          • 36575
          • 104 Posts
          Thanks so much - it was the missing ? (so simple!) and now it works