ExpressionEngine CMS
Open, Free, Amazing

Thread

This is an archived forum and the content is probably no longer relevant, but is provided here for posterity.

The active forums are here.

Conditionals not working

March 30, 2010 12:14pm

Subscribe [3]
  • #1 / Mar 30, 2010 12:14pm

    jwmatlock

    14 posts

    I’ve been struggling with this for a bit, so I thought I’d get some advice on what other things I should be looking for. I have this bit of code setup, but, if I am not in one of the groups specified below, I still get the result returned, instead of the if:else result. The thing is, I have the exact same conditional setup on another part of the site and it’s working there. What might I be overlooking?

    {if group_id == '7' OR group_id =='1' OR group_id == '8' OR group_id == '9'}
    <a href="#unique" class="productAdd">Add to Cart</a>
    {if:else}
    <a href="http://regular">Add to Cart</a>
    {/if}
  • #2 / Mar 30, 2010 12:25pm

    Max Lazar

    341 posts

    group_id - it’s your online member group id?

    Is it possible that you put this block inside of another ee tag like {exp:weblog:entries} (in this case is better to use member_group )?

  • #3 / Mar 30, 2010 12:41pm

    jwmatlock

    14 posts

    That was it!

    Thank you. It’s nice getting another perspective on things!

  • #4 / Mar 30, 2010 12:41pm

    Sue Crocker

    26054 posts

    Also add some if logged_in code. You might not be logged in depending on cookie settings.

    Thanks for the assist, Max!

  • #5 / Mar 30, 2010 12:42pm

    Sue Crocker

    26054 posts

    Glad you were able to figure out what the problem was. Don’t hesitate to post again as needed.

.(JavaScript must be enabled to view this email address)

ExpressionEngine News!

#eecms, #events, #releases