Image gallery: How to accomplish this?

Author Message

Shurbann Martes

Sunday 28 September 2003 10:32:11 am

Hello,
I'm trying to implement a image gallerie into eZ, but this is the problem I have:

Imagine I have 12 pictures, and I want to show the thumbnails in a 3x3 matrix that means I have two "pages" (one with 9, the other with 3 thumbnails)

If someone click on picture I want them to see the original picture and the sequence of 9 pictures-thumbnails it belongs to.
Anyone can point me in the right directions?

Greets,
Shurbann

mikle mikle

Monday 29 September 2003 1:52:53 am

First change your big picture template to make it show small thumbnails trail after big picture (this is rather simple), second step - in order to make pagecounters work - change template to fetch child data not from current node of the object (picture), but from it's parent, i have the template someplace if you need i can publish it here
Regards, Michael

Shurbann Martes

Monday 29 September 2003 2:01:45 am

Hello,

It sounds rather simple indeed but:
I want to show the same set of 9 pictures on my 3x3 matrix. So if picture 3 is shown, I dont want to show 3 to 12, but the set it belongs 1 to 10.

Is this what you're telling me?
Could you post the template, but if it is too long e-mail it to me.
Thank you very much.

Shurbann
shurbann[at]hotmail[dot]com
[at] = @
[dot]=.

Zinistry Vacana

Tuesday 30 September 2003 5:35:54 am

But what about 11 and 12?

just fetch data from the pics node, and make a line template which shows 3x3 pics, with a next button if more pics than 9 exists, and in full view of the pics, add a link with link to the obj-id of the other pics (check out previos and next in search f.ex

:)

Shurbann Martes

Tuesday 30 September 2003 7:01:26 am

Ok I understand all the above, but how do I know this object/pictures position in the array of available objects/pictures.

Because the position is crucial to know which set of 9 objects/pictures to show:

fetch picture sort by event
if pic[object] pos = 5 show in linetemplate 1 - 9
if pic[object] pos = 18 show in line template 10 - 18

I already took a look at the array handling oprators, but I cant see an operator that accomplish this.

Thank you,
Shurbann

mikle mikle

Tuesday 30 September 2003 8:47:35 pm

Yes, exactly what i did - it was the problem for me - when i click an image the gallery showed images from 1 to 9 for example, the trick i gave above gives the idea - you don't need to deal with any array structures ( actualy i was triyng to implemet this with fetching the current picture's pozition in the gallery, but didn't find way how to do this), so here is a template - it is just remake of standard full.tpl, the main change is fetching list data from parent object rather then from current one, also one more thing - for links make correct offset addition - just add current offset) for exapmle
<a href={concat('content/view/full/',$Child:item.node_id,'/offset/',$view_parameters.offset)|ezurl}>

Then it will be only one strange thing - when you will list pages your current page will be the same ( i mean the big picture ), if you want change this - remake google.tpl

so this is picture.tpl template

{let page_limit=4
list_count=fetch('content','list_count',hash(parent_node_id,$node.parent_node_id))}

{default content_object=$node.object
content_version=$node.contentobject_version_object
node_name=$node.name}

<html cutted here>

{let children=fetch('content','list',hash(parent_node_id,$node.parent_node_id,sort_by,$node.sort_array,limit,$page_limit,offset,$view_parameters.offset)) }
{section name=Child loop=$children }
<a href={concat('content/view/full/',$Child:item.node_id,'/offset/',$view_parameters.offset)|ezurl}>{attribute_view_gui attribute=$Child:item.object.data_map.image image_class=small }
</a>
{/section}
{/let}

<!--including new overriden google.tpl --->
<tr><td colspan=3 height=17 align=center>
{include name=navigator
uri='design:google.tpl'
page_uri=concat('/content/view','/full/',$node.node_id)
item_count=$list_count
view_parameters=$view_parameters
item_limit=$page_limit}
</td></tr>
</table>

<!-- current picture is shown big size -->
{attribute_view_gui attribute=$node.object.data_map.image} {attribute_view_gui attribute=$node.object.data_map.name}

{/default}
{/let}

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 31 2025 00:21:53
Script start
Timing: Jan 31 2025 00:21:53
Module start 'layout'
Timing: Jan 31 2025 00:21:53
Module start 'content'
Timing: Jan 31 2025 00:21:53
Module end 'content'
Timing: Jan 31 2025 00:21:53
Script end

Main resources:

Total runtime0.0227 sec
Peak memory usage4,096.0000 KB
Database Queries3

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0047 588.1563151.2109
Module start 'layout' 0.00470.0035 739.3672220.6875
Module start 'content' 0.00820.0129 960.05471,001.6953
Module end 'content' 0.02110.0016 1,961.750037.9922
Script end 0.0226  1,999.7422 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.002711.6991140.0002
Check MTime0.00104.5663140.0001
Mysql Total
Database connection0.00062.610710.0006
Mysqli_queries0.00219.423830.0007
Looping result0.00000.140910.0000
Template Total0.00114.710.0011
Template load0.00083.687310.0008
Template processing0.00020.952610.0002
Override
Cache load0.00062.451910.0006
General
dbfile0.00062.803180.0001
String conversion0.00000.033640.0000
Note: percentages do not add up to 100% because some accumulators overlap

Templates used to render the page:

UsageRequested templateTemplateTemplate loadedEditOverride
1print_pagelayout.tpl<No override>extension/community/design/community/templates/print_pagelayout.tplEdit templateOverride template
 Number of times templates used: 1
 Number of unique templates used: 1

Time used to render debug report: 0.0001 secs