i'm creating a portfolio site where artists can show projects. artists are a category
on a project page (from an artist) i want to show the artists other projects as well. this seems simple but i'm not sure how to do this:
// get the category_id
{exp:channel:entries channel="projects" status="open" limit="1" orderby="entry_date" sort="asc"}
{categories show_group="1"}
// parents from the categories are not artists but artist groups
{if category_id != "1" AND category_id != "2" AND category_id != "3" AND category_id != "4"}
<?php $artistid="{category_id}"; ?>
{/if}
{/categories}
{/exp:channel:entries}
// show all titles from the category id (artist id)
{exp:channel:entries channel="projects" category="<?php echo $artistid ?>" status="open" limit="50" orderby="entry_date" sort="asc" dynamic="off"}
{title} /
{/exp:channel:entries}
eg on portfolio/project/test-dave-eerste-van-de-dag, the artist_id is 6 but it doesn't work in the second exp:channel:entries. php is on output. probably it goes wrong with both input and output. there must be an easier way to do this!