Filtering categorized content in perch_content_custom
I would like to display all FAQs on a primary FAQs page, but also display select ones on other pages through the site.
To do this I have created a category set, and am trying to filter based on that without:
- displaying cat=abc in the URL; or
- without having to hard-code the category slug in perch_content_custom
FAQs region on the /more-info page includes the
perch:categories tag using the "massage-therapy-techniques" set:
<perch:categories id="techniques" label="Related technique(s)" set="massage-therapy-techniques" help="Set to display on a specific technique page" />
On individual "technique" pages, I call perch_content_custom:
<?php perch_content_custom('FAQs', array( 'template' => 'faqs.html', 'page' => '/more-info.php', 'category' => 'massage-therapy-techniques/systemic-deep-tissue-therapy', )); ?>
Which works as intended, as long the
category => is hard coded, OR if I have a URL like:
And I use
'category' => perch_get('cat') in the perch_content_custom call. But that string looks pretty goofy, and hardcoding it isn't practical in this instance.
What I would like is to use:
<?php perch_content_custom('FAQs', array( 'template' => 'faqs.html', 'page' => '/more-info.php', 'category' => perch_get('cat'), )); ?>
And end up with a URL like:
I suspect this comes down to a rewrite rule of some sort, but I am getting nowhere. Can anyone provide any insight into how this may be done?
Want to reply to this thread?Login with Perch