Forums / General / Gallery Collection Class?

Gallery Collection Class?

Author Message

Neo Pixel

Thursday 09 December 2010 5:58:09 am

Hi,

I have instances of multiple galleries under a folder and it's very time consuming to create thumbnails for each one.

Before I embark upon trying to develop a solution I'd just like to ask if anyone has already created a "collection.tpl" override class that takes the first photo from all the galleries underneath it and displays them in a gallery.

Please get in touch if you have and you're prepared to share (for a price obviously) :)

Asking stupid questions so you don't have to!

Lo' F.

Thursday 09 December 2010 2:52:38 pm

Hi Neo!

While I am hitting my head against my pc struggling with some of my own issues (eZ related of course!), I think that maybe I can help...

{def $galleries=fetch('content', 'tree', hash('parent_node_id', 2, 'class_filter_type', 'include', 'class_filter_array', array('gallery')))}
<div>
    {foreach $galleries as $gallery}
    <div>
               {def $gallery_thumbnail = fetch( 'content', 'list', hash( 'parent_node_id', $gallery.node_id, 'limit', 1, 'class_filter_type', 'include',  'class_filter_array', array( 'image') ) )}
               {foreach $gallery_thumbnail as $first_thumbnail}
                    <div class="image" >
                          {attribute_view_gui attribute=$first_thumbnail.object.data_map.image image_class=small}
                    </div>
               {/foreach}
    </div>
    {/foreach}
</div>

Hope this is the solution you're looking for...

loredanaebook.it

Neo Pixel

Friday 10 December 2010 4:11:45 am

Hi Lo'F

Thanks for the great start !!

I've tried this out and spotted a few issues.

1.It's grabbing the first image from all galleries. It should only be grabbing the images from the child galleries underneath the collection

2. I need the thumbs to be clickable.

3.They need to go into rows like the current gallery class.

Can you sort those out please???

then it'll be just like plogger! :)

Asking stupid questions so you don't have to!