There's a photo gallery software called Piwigo, where you can upload images and give them tags. Here's an example of a tags page using Piwigo:
http://galeriebocage.alterre-bourgogne.org/tags.php
As you can see in the example above, when you click on a tag, on the left side menu you get a box called "Mots-clés" (i.e. tags) where you can choose additional tags associated with the initial tag, narrowing down the selection. In my gallery I will have hundreds if not thousands of tags and images, where each tag could be associated with other hundreds of tags. Because of that I figured that I might as well add checkboxes near every tag, so that instead of clicking on one tag and then seeing a disorganized wall of tags on the left, the user will be able to specify their selection of tags immediately. Then they would click a button that would redirect them to a page containing images that have all the selected tags. This I have already accomplished.
The issue is that not every tag will be associated with all the other tags. For example, I might have tags "Blue Dragon", "Green Dragon", "Yellow Dragon", "Black Whale", "Yellow Whale", "Green Whale". Let's say that half of the images have all the dragon tags, and the other half have only the whale tags. The user is presented with a page where they can select any of the tags, and they select "Green Dragon" and "Green Whale". The problem is that this combination of tags doesn't exist. There are no images that have both of these tags, so the page doesn't exist. My idea is to maybe have it so that when a user selects "Green Dragon" all the checkboxes for "... Whale" get grayed out. Considering that I will have a very large collection of images and tags, I am wondering if this is something that could even be done easily?
I am not really asking for a code here (though if you do have something I would appreciate it), but any advice on how to do it. I suppose I would need to do in Javascript? Pull some variables from the php? I don't know.
Thank you.
Aucun commentaire:
Enregistrer un commentaire