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!

Powered by eZ Publish™ CMS Open Source Web Content Management. Copyright © 1999-2014 eZ Systems AS (except where otherwise noted). All rights reserved.

eZ debug

Timing: Jan 18 2025 02:19:52
Script start
Timing: Jan 18 2025 02:19:52
Module start 'layout'
Timing: Jan 18 2025 02:19:52
Module start 'content'
Timing: Jan 18 2025 02:19:53
Module end 'content'
Timing: Jan 18 2025 02:19:53
Script end

Main resources:

Total runtime0.5917 sec
Peak memory usage4,096.0000 KB
Database Queries57

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0052 587.9063152.6250
Module start 'layout' 0.00530.0031 740.531339.4375
Module start 'content' 0.00830.5819 779.9688543.2813
Module end 'content' 0.59020.0015 1,323.250012.1797
Script end 0.5916  1,335.4297 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00310.5265160.0002
Check MTime0.00130.2170160.0001
Mysql Total
Database connection0.00060.106110.0006
Mysqli_queries0.545192.1199570.0096
Looping result0.00050.0876550.0000
Template Total0.564195.320.2821
Template load0.00190.318220.0009
Template processing0.562295.022320.2811
Template load and register function0.00010.016710.0001
states
state_id_array0.00090.146010.0009
state_identifier_array0.00060.100120.0003
Override
Cache load0.00160.2661240.0001
Sytem overhead
Fetch class attribute can translate value0.00080.138420.0004
Fetch class attribute name0.00150.249050.0003
XML
Image XML parsing0.00080.131920.0004
class_abstraction
Instantiating content class attribute0.00000.002260.0000
General
dbfile0.00080.1339230.0000
String conversion0.00000.001640.0000
Note: percentages do not add up to 100% because some accumulators overlap

Templates used to render the page:

UsageRequested templateTemplateTemplate loadedEditOverride
1node/view/full.tplfull/forum_topic.tplextension/sevenx/design/simple/override/templates/full/forum_topic.tplEdit templateOverride template
3content/datatype/view/ezimage.tpl<No override>extension/sevenx/design/simple/templates/content/datatype/view/ezimage.tplEdit templateOverride template
3content/datatype/view/ezxmltext.tpl<No override>extension/community_design/design/suncana/templates/content/datatype/view/ezxmltext.tplEdit templateOverride template
4content/datatype/view/ezxmltags/paragraph.tpl<No override>extension/ezwebin/design/ezwebin/templates/content/datatype/view/ezxmltags/paragraph.tplEdit templateOverride template
1content/datatype/view/ezxmltags/literal.tpl<No override>extension/community/design/standard/templates/content/datatype/view/ezxmltags/literal.tplEdit templateOverride template
1print_pagelayout.tpl<No override>extension/community/design/community/templates/print_pagelayout.tplEdit templateOverride template
 Number of times templates used: 13
 Number of unique templates used: 6

Time used to render debug report: 0.0002 secs