Gallery image search

Have a question or a suggestion about a 3rd party addon module or plugin?
Let us know here.
Post Reply
howey
Forum Members
Forum Members
Posts: 158
Joined: Fri Sep 14, 2007 1:05 pm

Gallery image search

Post by howey »

Hi

I've got the Gallery module installed with one main gallery. I would like to try and use the search module to find individual images. The thumbnail template is formatted to show not only the image thumbnail, but also it's title and comments. I am using the Fancybox template.

At the moment if I search, even knowing that the image title contains a unique word the results return the page that the image appears on and then all the images in the gallery appear when you click on the search link.

Any suggestions how to narrow this down so the user can search for individual keywords and then only see the appropriate images. This may not be possible, but is certainly beyond my basic skills.

I'm using cmsms 2.1.5 and Gallery 2.1.6.

Any suggestions gratefully received.
Jos
Support Guru
Support Guru
Posts: 4017
Joined: Wed Sep 05, 2007 8:03 pm
Location: The Netherlands

Re: Gallery image search

Post by Jos »

howey wrote:if I search, even knowing that the image title contains a unique word the results return the page that the image appears on and then all the images in the gallery appear when you click on the search link.
I'm sorry. That's just the way Gallery was designed to do.
I don't think there is an easy way to make it act otherwise.
scooper
Forum Members
Forum Members
Posts: 242
Joined: Fri Dec 09, 2005 12:36 pm
Location: Marlow, UK

Re: Gallery image search

Post by scooper »

Yep - what Jos says. I think making the Search module work would be difficult

A possible alternative would be to have a input box on the thumbnails page that filters the images shown as the user types using javascript.

That would be fairly easy to do in just a few lines of js (assuming you have all the thumbnails on the page).

Here's a random fiddle that shows the kind of thing I'm thinking of: https://jsfiddle.net/rb7hm/4/
User avatar
velden
Dev Team Member
Dev Team Member
Posts: 3484
Joined: Mon Nov 28, 2011 9:29 am
Location: The Netherlands

Re: Gallery image search

Post by velden »

I guess search somehow returns the image ID which - I think - gives you some possible solutions:

* change the search template to link to the single image call of Gallery. Check this tag https://docs.cmsmadesimple.org/tags/cms ... action_url to create the url. Read Gallery help to learn how setup the single image template and how to call the single image action

* change the search template to add a query string to the Gallery url (http://....?...&img=<img_id>. Then in your Gallery template or Page template or page specific metadata use some smarty to check if the img parameter is set and if so, add some javascript to mimic a click on the image with that id.
Jos
Support Guru
Support Guru
Posts: 4017
Joined: Wed Sep 05, 2007 8:03 pm
Location: The Netherlands

Re: Gallery image search

Post by Jos »

velden wrote:I guess search somehow returns the image ID
No, Gallery only provides the gallery-id to search.
User avatar
velden
Dev Team Member
Dev Team Member
Posts: 3484
Joined: Mon Nov 28, 2011 9:29 am
Location: The Netherlands

Re: Gallery image search

Post by velden »

What was I thinking... :-)
howey
Forum Members
Forum Members
Posts: 158
Joined: Fri Sep 14, 2007 1:05 pm

Re: Gallery image search

Post by howey »

Hi

Sounds as if this might be a tricky one.

Would it be possible to either add additional functionality to the Gallery module to allow an image search, or ...

I dabble with other CMS's but I use CMSMS as my go to solution. Dependent on cost, I would be willing to fund the expansion of the module if it benefited the wider community. I have an immediate need, although it's not critical, so this might be a way for me to feed back into the project. As a designer, who implements code, this would be beyond my skills.
Jos
Support Guru
Support Guru
Posts: 4017
Joined: Wed Sep 05, 2007 8:03 pm
Location: The Netherlands

Re: Gallery image search

Post by Jos »

I've sent you a PM
Post Reply

Return to “Modules/Add-Ons”