0

I want to add an (optional) image gallery on each page of an eZ Publish 4.0.0 installation. I found some extensions but these galleries are extra pages, as far as I understand it. How can I achieve this?

It should not be a flash gallery and a simple output of all images in a thumbnail size would be fine, if I had the links to the images in a bigger size.

Yogesh Suthar
  • 30,424
  • 18
  • 72
  • 100
stofl
  • 2,950
  • 6
  • 35
  • 48

1 Answers1

0

Using the parent-children relationship should be an easy way to achieve that on all your content independently of the content class.

You will have to set the container flag on every content class that will hold a gallery.
Then you should be able to add sub-nodes to the instances, so you will just have to add 'Image' sub-nodes to the node that hold the gallery.

After that, all you have will have to do will be to fetch the images in your node template like this:

{def $gallery_images= fetch( 'content', 'list', hash(
   'parent_node_id', $node.node_id,
   'sort_by', $node.sort_array,
   'class_filter_array', array('image'),
   'class_filter_type', 'include'
))}

And loop to display them with the image alias you want:

<ul class="gallery">
{foreach $gallery_images as $image}
<li>{attribute_view_gui attribute=$image.data_map.image image_class='small'}</li>
{/foreach}
</ul>

If you can upgrade to a more recent version of eZ Publish, you will also be able to use the multi ulpload extension that will make it a breeze to upload multiple images at once.

Eric
  • 2,784
  • 1
  • 20
  • 25