SOLVED - How to exclude Gallery from local search results

Have a question or a suggestion about a 3rd party addon module or plugin?
Let us know here.
Post Reply
User avatar
Darwin Web Design
Forum Members
Forum Members
Posts: 212
Joined: Tue May 30, 2006 3:12 am

SOLVED - How to exclude Gallery from local search results

Post 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.
Last edited by Darwin Web Design on Mon Jun 21, 2010 12:27 pm, edited 1 time in total.
Ted
Power Poster
Power Poster
Posts: 3329
Joined: Fri Jun 11, 2004 6:58 pm

Re: How to exclude Gallery from local search results

Post 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.
calguy1000
Support Guru
Support Guru
Posts: 8169
Joined: Tue Oct 19, 2004 6:44 pm

Re: How to exclude Gallery from local search results

Post 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.
Follow me on twitter
Please post system information from "Extensions >> System Information" (there is a bbcode option) on all posts asking for assistance.
--------------------
If you can't bother explaining your problem well, you shouldn't expect much in the way of assistance.
Ted
Power Poster
Power Poster
Posts: 3329
Joined: Fri Jun 11, 2004 6:58 pm

Re: How to exclude Gallery from local search results

Post by Ted »

Yeah, he's right.  I forgot about the obvious way to do it...

http://forum.cmsmadesimple.org/index.ph ... #msg203179
User avatar
Darwin Web Design
Forum Members
Forum Members
Posts: 212
Joined: Tue May 30, 2006 3:12 am

Solved - How to exclude Gallery from local search results

Post by Darwin Web Design »

Thank you for your help, this worked perfectly. Sorry I didn't find this myself when searching the forums.
Post Reply

Return to “Modules/Add-Ons”