I'm looking to create a set of drop down boxes, which filter the photos in my album based on tags that they have, so for example the user picks 'cars' from the first drop down, then in the second drop down he picks from all the remaining tags that relate to cars so maybe 'ford' and then in the next drop down he picks the last tags that relate to both cars and ford so maybe 'galaxy' then it filters and shows all the photos which relate to all three tags
Does anyone know of a theme which has this implemented already? or some suggestions how i would go about creating it?
thanks
No, such plugin does not exist. But we have already a tag suggest plugin which is included. Also with the current release you can perform searchs in search results.
You purpose would be quite impossible as there is no way to sort out tags for these three separate tag lists or sets you mention. Except you name them with pre- or suffixes (like "vehicle_car", "vendor_ford", "model_galaxy". Otherwise a tag is just a tag.
More to the point. What you wish would require doing a search after each drop-down selection. That is, if you select "cars" with the first drop-down there would have to be a search of all matches on "cars" and then an extract of all the tag associated with these images. Then the second drop-down could be populated from that extraction. This would be a quite complex undertaking since the drop-down would be JavaScript on the browser but the searches, etc. would have to come from the Server.
You only other option would be to pre define these choices. But this would mean you would have to re-generate the choices whenever anything changed.
could it be done using the jQuery and then querying the sql database before having to render the html?
I like the idea behind it, and functionally it could work I think.
Edit:
The more I think on it, there would likely have to be some additional enhancements to the tags system itself to accomplish what the OP suggests. Kind of like a hierarchy structure for tags.
Not a bad idea, just not sure if it's feasible.
It could be accomplished via proper tagging of the photos as well though so no structure would have to be put in place.
Speaking of which I've been meaning to add a feature request on tags/categories as well... pulls up Trac
I think it is against the concept of tags/keywords to be hierachic. You could solve this by adding suffixses or prefixes to tag names maybe ("carvendor_ford", "carmodel_galaxy" for example). Still some extra coding necessary.
Maybe it would be better to store the images already in an album structure. That would probably make the above a little easier since there is already a hierachic structure.
Yeah, I agree that it would go against the nature of tags to be hierachic. It could even be done however just by properly tagging the photos, for instance only photos of cars would be tagged with "cars" etc.
However the functionality of the drop-down search is still something that would be a nice addition and should be doable via jQuery/SQL interaction I'd think. Populate the drop downs on the fly via jquery then display the actual search results when the search button is clicked.
Could also make for a quite interactive gallery, as people might be more inclined to check a photo out that's tagged instead of having to dig through 2-3 layers of albums to find the photo.
The idea with the albums was actually an idea because then generating hierachic results would be easier (so in "cars" only would be albums for the vendors and within albums for hte models).
Since your idea would have to be ajax+jquery it would probably be possible as a plugin.
Anyway, feel free to work on it...:-)