In that case you could do it in several ways by using parameters in your channel entries tag:
Show all entries from any category belonging to a specific category group
{exp:channel:entries channel="mychannel" category_group="2"}
Show all entries from a specific category group and specific categories with ID’s 3,5,7 within:
{exp:channel:entries channel="mychannel" category_group="2" category="3|5|7"}
Show all entries from a specific category from any group
{exp:channel:entries channel="mychannel" category="3"}
Show all entries from several categories
{exp:channel:entries channel="mychannel" category="3|5|7"}
From the docs for reference: https://docs.expressionengine.com/latest/channel/channel_entries.html#id29 https://docs.expressionengine.com/latest/channel/channel_entries.html#id30
OK… Yeah… so I saw all of that, & I guess I’m on the right track then, but if my channel entry for products is assigned to categories 1,3, & 5,
How would I pass those ID’s into my Blog posts channel to display only blog posts in the sidebar that are assigned to those 3 categories?
Russ
Just use the category parameter like this.
{exp:channel:entries channel="mychannel" category="1|3|5" dynamic="no" limit="5"}
As its in your sidebar I’ve also added in the dynamic=no parameter to will ensure that EE doesn’t base results based on the URL segments, and a limit= parameter so you can lomit the number of entries displayed.
Packet Tide owns and develops ExpressionEngine. © Packet Tide, All Rights Reserved.