Project:Simple Gallery
Version:6.x-1.3
Component:User interface
Category:support request
Priority:normal
Assigned:Unassigned
Status:postponed

Issue Summary

I've setup the vocabulary to be the free-form tags field that I'm using throughout the site. This appears to be working, but when I go to the gallery page, I get a gallery for every tag term I've used on the site, regardless of the content type of the item. I think that if you changed the items you count to only be the "Image" type (or whatever name we give them), you could fix this. Just a guess. Really nice setup otherwise.

Comments

#1

So basically what you are saying, is in addition to having a taxonomy vocab restriction on the settings page, you also want a content type restriction? That is doable and is something I can look into for the next release. With the way it currently is, it is just assumed that the vocabulary used for the gallery is only be used for the gallery images, which is why it does not check for a specific content type.

#2

That sounds about right. I'm just now getting into Drupal development, but if you could point me in the general direction, which file to look in, I could take a stab at a hard coded version for myself. I'd be happy to share anything I come up with. Thanks again for making a simple, doable solution to galleries in Drupal.

#3

In simplegallery.module there are 3 statements that select files. One for counting the number of nodes to be displayed, one for the main gallery view and one for the individual album pages. The user would need to select a content type with the form in function simplegallery_admin().

It then needs to pass that value to the following existing code:

<?php
$count
= db_result(db_query("SELECT COUNT(nid) FROM {term_node} WHERE tid = %d", $term->tid));
?>

The following code needs to not add the nid of the node if it isn't of the correct content type. This is the code for function simplegallery_all().

<?php
while (($row = db_fetch_object($children)) && (count($nodes)<$numimages)) {
             
$nodes[] = $row->nid;
            }
?>

Same with the following code in function simplegallery_sub()

<?php
while ($row = db_fetch_object($children)) {
             
$nodes[] = $row->nid;
            }
?>

I will get to this before the next release, but hopefully this lets you know what's going on if you want to take a look.

#4

Status:active» postponed
nobody click here