Forums / Developer / how to add more tag in attribute_view_gui for image?

how to add more tag in attribute_view_gui for image?

Author Message

Quynh Nguyen

Thursday 05 March 2009 11:49:26 am

This is the sample from Serwatka: http://serwatka.net/photos/canary_islands_tenerife_2008

I really want to create the same gallery, but I don't know how to add more tag in result likes that:

<div class="attribute-image" style="width: 75px; height: 75px;"> <a href="/var/site_cache/storage/images/photos/canary_islands_tenerife_2008/1/2887-1-eng-GB/1_imagelarge.jpg" rel="lightbox[428]"><img src="/var/site_cache/storage/images/photos/canary_islands_tenerife_2008/1/2887-1-eng-GB/1_gallerythumbnail.jpg" alt="" /></a> </div>
 

That means I must include more tags:
rel="lightbox" in <a... >

and more attribute: caption or alternative text.

Please help me!

Jean-Yves Zinsou

Thursday 05 March 2009 12:08:43 pm

Hi there,
take a look at :
design/standard/templates/content/datatype/view/ezimage.tpl

you will understand how it works and the parameters that are used.

if you call

{attribute_view_gui attribute=$node.object.data_map.myimage image_class='large'}

image_class is used in the ezimage.tpl to define the size of the image to use.
Other parameters :

- image_class - Which image alias to show, default is large
- css_class - Optional css class to wrap around the <img> tag, the class will be placed in a <div> tag.
- alignment - How to align the image, use 'left', 'right' or false().
- link_to_image - boolean, if true the url_alias will be fetched and used as link.
- href - Optional string, if set it will create a <a> tag around the image with href as the link.
- border_size - Size of border around image, default is 0

feel free to add your own :

{attribute_view_gui attribute=$node.object.data_map.myimage image_class='large' my_new_attribute='blabla'}

then override properly the ezimage.tpl and you can use you new attribute in it like :

my new attribute is {$my_new_attribute }

quick and dirty way : modify directly the design/standard/templates/content/datatype/view/ezimage.tpl

Hope this helps !

Jey

Do Androids Dream of Electric Sheep?
I dream of eZpubliSheep....
------------------------------------------------------------------------
http://www.alma.fr

Yannick Komotir

Friday 06 March 2009 12:55:19 am

Hi,

However you can use Nabil's extension http://ez.no/developer/contribs/applications/ezlightbox

<|- Software Engineer @ eZ Publish developpers -|>
@ http://twitter.com/yannixk