Does anyone know how I can switch an ID depending on category.
I have 5 categories assigned to my channel ‘Work’ these are ‘All’ which is the parent category, ‘Print’, ‘Website’, ‘Branding’ and ‘Marketing’ which are child categories of ‘All’.
My code is as follow…
<div id="pp-img">
{exp:channel:entries channel="work" limit="1" status="New|Open"}
{project_img}
{/exp:channel:entries}
<a href="http://{site_url}work/category/all" title="Back to Work"> ← Back to work</a>
</div>I need to change the id ‘pp-img’ assigned to the opening ‘<div>’ when a project is given the category of ‘Website’ to ID ‘pw-img’.
Only problem is this ‘<div>’ resides outside of the Channel Entries Tag pair.
Does anyone have any suggestions to how I might achieve this ID switch?