Collection filter using categories
So, I'm new to perch and need some help. I have a list of content, which I want the user to filter using some categories I have setup. This is where I'm at: 1. I have created a category for a listing of items (work type: All, Branding, Property, Web) 2. I have created a collection list of all items. 3. Now I want to output those categories as a form of radio options, so user can select one and see a filtered list of those items. I have created a form of radio's:
<perch:form id="filter" method="get"> <ul> <perch:input id="categoryFilter" type="radio" options="All, Branding, Property, Web" class="radio" wrap="li" /> </ul> </perch:form>
and this is what my template looks like:
<div class="c-filters"> <?php perch_form('work_filters.html'); ?> </div> <div class="c-listing"> <?php perch_collection('Work items', array( 'template' => 'work-items-landing.html', 'page' => '/our-work.php', 'category' => perch_get('work-type/Branding'), 'category-match' => 'any', )); ?> <div id="loadMore" class="loadMore"> <a href="#" class="c-btn c-btn-clear--black">Load More</a> </div>
I know the template 'perch_collection' isn't quite right, and im not sure how to link up the radio output to the category 'work-type'. Any help very welcome.