Page 1 of 1

SOLVED - How to exclude Gallery from local search results

Posted: Sun Jun 20, 2010 10:38 am
by Darwin Web Design
Hello

I'm wondering if it is possible to exclude gallery items from the search results when using the local search facility... I'm using Gallery 1.1.1 at the moment.

I have looked at the forums and some people mention to try: to put this in the template to exclude items from the search engine, but I have tried this but it didn't work.  I tried this on both the page itself and also in the template within the gallery settings.

I've unticked the 'cachable' and 'seachable' options in the actual page that the gallery is showing, but this doesn't help because the search results aren't displaying that page but rather an unformatted listing of photos directly from the gallery database.

I will be interested to see if there is a fix for this.

Thanks.

Re: How to exclude Gallery from local search results

Posted: Sun Jun 20, 2010 12:12 pm
by Ted
The only way to do it is to edit the modules/Gallery/Gallery.module.php file, and comment out or remove the entire SearchResult method.  Search results will still be stored in the database, but they should get skipped over when it comes time to display them.

Re: How to exclude Gallery from local search results

Posted: Sun Jun 20, 2010 1:04 pm
by calguy1000
Actually, Ted is incorrect.

It's quite easy to do, without modifying any PHP code.  This question has been asked and answered before.  All you have to do is modify the search result template in the Search module.

Re: How to exclude Gallery from local search results

Posted: Sun Jun 20, 2010 5:07 pm
by Ted
Yeah, he's right.  I forgot about the obvious way to do it...

http://forum.cmsmadesimple.org/index.ph ... #msg203179

Solved - How to exclude Gallery from local search results

Posted: Mon Jun 21, 2010 12:26 pm
by Darwin Web Design
Thank you for your help, this worked perfectly. Sorry I didn't find this myself when searching the forums.