Im using a subclass of ImageGallery - 'MyImageGallery' and have set up a check box (Set) to hide certain images which are part of a set so they hide the thumbnails but are still part of the gallery.
However I just started using it with "Number of images per page" and it still counts the hidden thumbs, therefore not showing the full amount per page. Can I control which images are counted in the "Number of images per page" count?
Here's some of the code I'm using:
GalleryUI_layout.ss
<% control GalleryItems %>
<% if Set %>$GalleryItem<% else %>
<li style="height:auto;width:{$ThumbnailWidth}px;">
$GalleryItem
<p>$PaintingName</p>
</li><% end_if %>
<% end_control %>
Lightbox_Item.ss
<% if Set %>
<a id="ViewLink-$ID" rel="lightbox" class="lightbox" title="$Caption.EscapeXML" href="$ViewLink"></a>
<% else %>
<a id="ViewLink-$ID" rel="lightbox" class="lightbox" title="$Caption.EscapeXML" href="$ViewLink">
<img src="$ThumbnailURL" alt="$Title.EscapeXML"/>
</a>
<% end_if %>
MyImageGalleryItem.php
<?php
class MyImageGalleryItem extends ImageGalleryItem
{
static $db = array (
'Set' => 'Boolean',
'PaintingName' => 'Varchar(100)'
// etc...
);
public function getCMSFields_forPopup()
{
$f = parent::getCMSFields_forPopup();
$f->push(new CheckboxField('Set','Part of a set, hide the thumbnail'));
$f->push(new TextField('PaintingName','Name of work'));
return $f;
}
}
?>
Thanks!