1

I think I may be getting a parse order problem when I try and use Low's seg2cat variable in a conditional with Stash.

Here's my code:

{exp:stash:set name="pg_content_left"} 

    {if segment_2_category_id != ''}

        {exp:stash:set_list name="news_list" parse_tags="yes" parse_depth="2"}
            {exp:channel:entries channel="news" status="open|featured" orderby="date" sort="desc" limit="10" category="{segment_2_category_id}"}
                {stash:item_title}{title}{/stash:item_title}
            {/exp:channel:entries}
        {/exp:stash:set_list}
    {/if}
 {/exp:stash:set}

Here's my error message:

A PHP Error was encountered
Message: Invalid EE Conditional Variable: {if segment_2_category_id != ''}

If I run the IF statement outside of stash:set it fails gracefully. I presume Stash is being parsed before low seg2cat variable is available. Anyone know how I can get around this?

Thanks.

3
  • 1
    did you try to setup Set all segments to Yes in seg2cat ext. settings?
    – Max Lazar
    Feb 14, 2014 at 4:18
  • Thank you Max, that did the trick. I wasn't aware of that setting.
    – KoalaKid
    Feb 14, 2014 at 7:49
  • Great, lets add this as answer.
    – Max Lazar
    Feb 14, 2014 at 8:24

1 Answer 1

2

Try to setup Low seg2cat extension parameter Set all segments to Yes.

Your Answer

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

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