I would like to show only entries that have either category 1 or 2 and either 3 or 4. Something along the lines of: {exp:channel:entries category="(1|2)&(3|4)"}
Is there any way of doing this? The only way I can think of is by doing one group, and then passing through the entry_id
s of the results into an embed that then specifies the second group along with the entry_id
s. i.e.
{!-- Main template --}
{embed="embed"
entries="
{exp:channel:entries category='1|2'}
{entry_id}|
{/exp:channel:entries}
"}
{!-- Embedded template --}
{exp:channel:entries category="3|4" entry_id="{embed:entries}"}
{!-- Do stuff --}
{/exp:channel:entries}
But this seems very messy (and I’m not really sure if that whole loop-inside-an-embed thing will even work)
Tricky. I like the idea of that syntax, but it’s just not going to work (category=”(1|2)&(3|4)). I also don’t think category="3|4" entry_id="{embed:entries}"
will work- you can embed it, but I expect it’s still going to work like an ‘and’.
One option would be to use the query module and get all of the entry ids that meet your category requirements (query exp_category_posts) and send that over as an embed variable. That would work. You can just use the normal parameters in the tag with the embed to make sure the entries are in the correct status, date range, etc.
That would be my first option.
Packet Tide owns and develops ExpressionEngine. © Packet Tide, All Rights Reserved.