0

Currently I'm trying to use if statements to determine what category to filter on. I'm using a combination of freebie and embed. However, I can't seem to find the right syntax to filter correctly. I have tried different orders for the if statements.

Broken: {exp:channel:entrieschannel="resources" {if freebie_break_1}category='{freebie_break_1}'{if:else embed:category}category='{embed:category}'{/if} {if freebie_break_2}category2="{freebie_break_2}"{/if}... normal channel params}

Works:

{if embed:category}category='{embed:category}'{/if}

Can someone let me know if category selection simply won't allow me to have this syntax?

1 Answer 1

2

You can 't use freebie this way because the freebie segments are parsed after the Channel Module.

My suggestion is to use freebie before the embed, on the parent template.

I tried to suggest you a code, but I couldn't figure what is the category2 parameter.

This is the closest I could get:

{embed="foo/bar"
    {if freebie_break_1}
        category="{freebie_break_1}"
    {if:else}
        category="DEFAULT_CATEGORY"
    {/if}
}
1
  • I decided to go this way. I inherited a template and tried to consolidate them. I have ended up creating a parent template just for routing to the main template.
    – Chris
    Sep 26, 2014 at 15:08

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.