Forum
On a single category page, how do I display only the items within that category?
I've watched the Portfolio with Categories video and I'd like to achieve the same functionality, but with perch_collection
instead of perch_content_custom
How would I make the perch_collection
part dynamic?
I've only used 'category'=>'name-of-set-here/retail'` to see if I can get it working - I'd like this part to be dynamic.
if (perch_get('cat')) {
perch_category('/name-of-set-here/'.perch_get('cat'),array(
'template'=>'category_single.html',
));
perch_collection('Projects', array(
'category'=>'name-of-set-here/retail', // How do I make this dynamic?
));
} else {
perch_categories();
}
I thought if replaced 'category'=>'name-of-set-here/retail'
with
'category'=> '/name-of-set-here/' . perch_get('cat'),
It'd work, but it doesn't. I'd like to dynamically display items within the current category.
Sorted it:
Here's the full code, hope it helps someone out: