Forum
Perch Search App - Excluding/Including apps
Hi guys,
I'm trying to use perch_content_search( )
to return two separate result sets:
- Results from the Blog App.
- Results excluding the Blog App.
In the docs, it says that I can use the apps
parameter to restrict my search to certain apps (such as PerchBlog
).
This doesn't seem to work. Please see below for my code:
perch_content_search($q,[
'apps'=>'perch_blog',
'template'=>'htb_article-returned.html'
]);
I've tried it with PerchBlog
, blog
, perchblog
, Perch_Blog
and perch_blog
, but still they return content from pages on the site and doesn't appear to be restricted to the Blog App.
Also - is it possible to exclude apps from the search, rather than include them? I'd need to be able to exclude the Blog App from the second result set, and I was wondering if Perch is able to do that.
Thanks, Harry
Hello Harry,
I think you need to pass an array:
Hi Hussein,
Thanks for the help! That's sorted now, thanks!