Forum
Perch Custom Filter by Slug
Hi All,
Just wondered if i could filter on the blog post category and match it to the current page slug?
i was trying this out, but no joy.
any help/advice be much appreciated.
<?php
perch_blog_custom(array(
'template' => 'post_in_list--sidebar.html',
'filter' => 'category_names',
'match' => 'contains',
'value' => perch_get('s'),
'sort' => 'postDateTime',
'sort-order' => 'DESC',
'count' => 3
));
?>
Is the slug a category slug? I don't understand what the value of s is.
Hi Rachel,
The value of s is a slug generated from an id on a piece of content which is displayed using another template on the page, then i wish to display blog posts that have a blog category that match that slug. is this possible?
If i remove the filter code the latest posts are displayed and i can see the slugs on the url of the post title. I can also see the slugs i have added to the current page url.
my debug shows the below, i may be doing something completely the wrong way, so apologise in advance.
dan
Should be possible.
Cheers Drew, whilst your in Brighton as well!!!
works perfect!!