Hi-
I am trying to figure out the best way to oragnize my Gallery 2 by drupal catergories. I was thought about using the custom fields in Gallery2 and then calling those from Drupal, but I think the quickest would be to use the Gallery2 keyword albums.
I was hacking at the taxonomy_menu module and figured out a way to display keyword albums using Drupal's taxonomy.
taxonomy_menu:
$access = user_access('access content');
foreach (taxonomy_get_vocabularies() as $vocabulary) {
if (variable_get('taxonomy_menu_show_'. $vocabulary->vid, 1)) {
$path = 'taxonomy_menu/'. $vocabulary->vid;
$items[] = array('path' => $path, 'title' => t($vocabulary->name),
'callback' => 'taxonomy_menu_page', 'access' => $access,
'weight' => $vocabulary->weight);I changed that to:
$access = user_access('access content');
foreach (taxonomy_get_vocabularies() as $vocabulary) {
if (variable_get('g2Keyword_menu_show_'. $vocabulary->vid, 1)) {
$path = 'http://localhost/main/key/'. $vocabulary->name;
$items[] = array('path' => $path, 'title' => t($vocabulary->name),
'callback' => 'g2Keyword_menu_page', 'access' => $access,
'weight' => $vocabulary->weight);Here is an example-
If my taxnomy is:
Photograpy
-Animals
-Dogs
-Cats
-People
-Couples
-Babies
Artwork
-Portraits
-Couples
-Babies
I have an image that has these keywords: photography animals dogs
I would like to:
- Using Drupal's taxonomy, I would like to organize my Gallery2 keyword albums (call the module g2keyword_menu) so that when you click "photography" you would be shown all items with the Keyword "photography". (I have been able to do this as above.)
- When you click on Animals. You should get a keyword album for all the items that have the keyword "photography animals". This doesn't work for animals because I end up with http://localhost/main/key/photography/9. This should be http://localhost/main/key/photography+animals.
- When you click on Animals, the title should be switched to just showing animals (not Keyword album: Photography Animals).
- The breadcrumb trails should be: home>gallery>photography>animals (not home>gallery>keyword album: photography animals)
- Also, the menus should expand the way taxonomy_menu expands when you click on a parent category.
Finally, I am thinking that it may make more sense to use Gallery2 tagging instead.
Any thoughts?
Any help would be great!
Gallery 2.2.1
Drupal 5.x
Drupal taxonomy_menu module
Gallery2 keyword album module
URL rewrite is on for both.
Comments
Comment #1
pinxi commentedI have been talking with the programmers over at Gallery2 about the development of the taggin module. See tags codex.
I am trying to figure out a way to link Drupal to Gallery 2 using tags in a hierarchical manner. For example, say you have a tag called Canada and wanted to view flowers in Canada, you would have:
(or example.com/?q=gallery&g2_view=tags.VirtualAlbum&g2_tagName=Canada/flowers without URL rewrite.) .
Another example would be if you wanted to see only white flowers in Canada.
The second part of this would be to create the category list using Drupal's taxonomy. I hacked the taxonomy_menu module so you get the following:
example.com/?q=gallery&g2_view=keyalbum.keywordAlbum&g2_keyword=Canada/flowers/white
If you click on menu item flowers,
the url is example.com/?q=gallery&g2_view=keyalbum.keywordAlbum&g2_keyword=Canada/flowers.
Please see the code below. I was using keywords before finding the tagging module which is a lot more powerful and scaleable. Still the idea is the same for tagging.
Currently, I have the following issues:
Any help would be most appreciated!