0

I have this in my template:

{exp:channel:entries
    channel="profiles"
    disable="categories|category_fields|member_data|pagination"
    {if segment_2}entry_id="not {segment_2}"{/if}
    dynamic="no"
}
    {if {profession}{profession:title}{/profession} == "foo"}
        <!-- display something -->
    {/if}
{/exp:channel:entries}

This returns the error:

Error

You have an invalid conditional in your template. Please review your conditionals for an unclosed string, invalid operators, a missing }, or a missing {/if}.

Parser State: Invalid Condition: Not enough operands for operator ” == “.

What is wrong with my template? Is the test in my if-statement somehow causing this problem? Is there a way I can add this filter as a search in the channel entry tag?

2

First thing to try is to remove the second conditionl to be sure it's that one which causes the problem.

Try using quotes in your second conditional so it looks like;

{if "{profession}{profession:title}{/profession}" == "foo"}
    <!-- display something -->
{/if}

Though it would be better to reformat it slightly to:

{profession}
    {if profession:title == "foo"}
        <!-- display something -->
    {/if}
{/profession}

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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