I currently have a couple of category groups that look like this:
Category 1 ‘project types’:
- cat 1: project type one
- cat 2: project type two
- cat 3: project type three
- cat 4: project type four
Category 2 ‘featured’:
- cat 5: Featured
So I have a channel full of projects that have various categories assigned.
I want to display them on will contain a section where I show the featured projects for a project type and then below for others. So roughly my page currently looks like this:
FEATURED
{exp:channel:entries channel="project" category="1&5" dynamic="off" orderby="client_name" sort="asc"}
>RENDER<
{/exp:channel:entries}
OTHER
{exp:channel:entries channel="project" category="1" dynamic="off" orderby="client_name" sort="asc"}
>RENDER WITH SWITCH FOR COLUMNS<
{/exp:channel:entries}
Now obviously the ‘other’ section is currently broken, it’s displaying all the projects of type 1. I’ve tried setting category=‘1 not 5’.. this doesn’t seem to work.
So my frist question is, does it actually work and am I missing some other bug?
My current solution is a hodgepodge of php that checks the categories for the featured categories and selectively does not render them, the problem is that this screws up {switch} for my multi column layout… so I could go deeper down this road its more php which is fine, but ugly and harder to maintain.
I guess I could go to the query plugin to create my more complicated query, but again, lowers maintainability.
My followup questions are:
1) is there a preferred way to make this work?
2) is there some way to do a sub query on a returned entries recordset?