eZ Community » Forums » Developer » Image gallery: How to accomplish this?

Image gallery: How to accomplish this?

Image gallery: How to accomplish this?

Sunday 28 September 2003 7:32:11 pm - 5 replies

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?


Modified on Sunday 28 September 2003 7:32:33 pm by Shurbann Martes

Monday 29 September 2003 10: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

Modified on Monday 29 September 2003 10:53:35 am by mikle mikle

Monday 29 September 2003 11:01:45 am


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.

[at] = @

Modified on Monday 29 September 2003 11:27:06 am by Shurbann Martes

Tuesday 30 September 2003 2:35:54 pm

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

happy.gif Emoticon

Tuesday 30 September 2003 4:01:26 pm

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,

Modified on Tuesday 30 September 2003 4:03:19 pm by Shurbann Martes

Wednesday 01 October 2003 5:47:35 am

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

{default content_object=$node.object

<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 }

<!--including new overriden google.tpl --->
<tr><td colspan=3 height=17 align=center>
{include name=navigator

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



You must be logged in to post messages in this topic!

36 542 Users on board!

Forums menu

Proudly Developed with from