0

I'm trying to get this if statement to work, not sure what I'm doing wrong. This is my code:

{categories}{if remaining_places_available<1 && category_id==259}<p><strong>Fully booked</strong></p>{/if}{/categories}

This is within the channel entries tag. the remaining_places_available is a field. Replacing && with AND doesn't work either. It's just outputting {categories} {/categories} on the front end.

Would really appreciate some help.

Thanks, Julie

EDIT: This is my channel entries tag:

{exp:channel:entries channel="choices_events" show_future_entries="yes" show_expired="no" disable="trackbacks" orderby="date_time" sort="asc" paginate="bottom" status="open" dynamic="no" parse="inward"}

This works fine in my code, and outputs '259' on the correct entries:

{categories}
    {if category_id == "259"}259{/if}
{/categories}

I just can't get it to work within the other if statement :

{categories}{if remaining_places_available<1 && category_id==259}<p><strong>Fully booked</strong></p>{/if}{/categories}
1
  • Can you post your code? You may have the categories disabled in your channel:entries tag
    – Siebird
    Jun 8, 2013 at 15:54

1 Answer 1

2

First, let me say that "trackbacks" isn't a value of the parameter disable anymore.

Now, let's make your conditionals to work.

I didn't realize until see your code, but looks like just the variables related to the {categories} tag pair are available inside it.

Since, your conditional uses an "AND", we can break it into two parts:

{if remaining_places_available < 1}
    {categories}
        {if category_id == 259}<p><strong>Fully booked</strong></p>{/if}
    {/categories}
{/if}
0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.