I've added a setting on the settings form [image_gallery.module]

+  $form['gallery']['image_gallery_list_empty_galleries'] = array(
+    '#type' => 'checkbox',
+    '#title' => t('List empty galleries'),
+    '#default_value' => variable_get('image_gallery_list_empty_galleries', 1),
+    '#description' => t("Checking this will always list galleries, even if they are empty."),
+  );

which is used during while theming function theme_image_gallery($galleries .. to
NOTlist a gallery when it's $gallery->count is ZERO

+      if(!variable_get('image_gallery_list_empty_galleries', 1) and !($gallery->count)){
+        //don't display empty galleries
       }
CommentFileSizeAuthor
image_gallery.module.patch2.63 KBdemeester_roel

Comments

demeester_roel’s picture

subscribe

underpressure’s picture

Could this be modified to hide a gallery that isn't empty? If I just added 100 photos to a new gallery I don't want site visitors to see this photos until I've labeled and added descriptions to all the photos.

drewish’s picture

this should be done against the 2.x branch. i'm not considering new features for the 1.x branch.

Hetta’s picture

Version: 5.x-1.6 » 5.x-2.x-dev
Status: Needs review » Needs work
Hetta’s picture

Status: Needs work » Closed (duplicate)

duplicate: http://drupal.org/node/234845 - later, but has a patch.

demeester_roel’s picture

irw http://drupal.org/node/216684#comment-713403
Could you make that an extra feature request. It is not really related to this request