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

eZ debug

Timing: Jan 18 2025 11:30:44
Script start
Timing: Jan 18 2025 11:30:44
Module start 'content'
Timing: Jan 18 2025 11:30:45
Module end 'content'
Timing: Jan 18 2025 11:30:45
Script end

Main resources:

Total runtime0.8953 sec
Peak memory usage4,096.0000 KB
Database Queries196

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0051 587.8594180.8125
Module start 'content' 0.00510.7435 768.6719589.9219
Module end 'content' 0.74860.1466 1,358.5938336.7422
Script end 0.8952  1,695.3359 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00420.4722210.0002
Check MTime0.00150.1672210.0001
Mysql Total
Database connection0.00070.079410.0007
Mysqli_queries0.816191.15671960.0042
Looping result0.00230.25981940.0000
Template Total0.858495.920.4292
Template load0.00220.247120.0011
Template processing0.856195.628620.4281
Template load and register function0.00010.016610.0001
states
state_id_array0.00330.372010.0033
state_identifier_array0.00270.307120.0014
Override
Cache load0.00190.2140370.0001
Sytem overhead
Fetch class attribute can translate value0.00180.197040.0004
Fetch class attribute name0.00170.191450.0003
XML
Image XML parsing0.00130.149240.0003
class_abstraction
Instantiating content class attribute0.00000.001350.0000
General
dbfile0.00320.3569330.0001
String conversion0.00000.000730.0000
Note: percentages do not add up to 100% because some accumulators overlap

CSS/JS files loaded with "ezjscPacker" during request:

CacheTypePacklevelSourceFiles
CSS0extension/community/design/community/stylesheets/ext/jquery.autocomplete.css
extension/community_design/design/suncana/stylesheets/scrollbars.css
extension/community_design/design/suncana/stylesheets/tabs.css
extension/community_design/design/suncana/stylesheets/roadmap.css
extension/community_design/design/suncana/stylesheets/content.css
extension/community_design/design/suncana/stylesheets/star-rating.css
extension/community_design/design/suncana/stylesheets/syntax_and_custom_tags.css
extension/community_design/design/suncana/stylesheets/buttons.css
extension/community_design/design/suncana/stylesheets/tweetbox.css
extension/community_design/design/suncana/stylesheets/jquery.fancybox-1.3.4.css
extension/bcsmoothgallery/design/standard/stylesheets/magnific-popup.css
extension/sevenx/design/simple/stylesheets/star_rating.css
extension/sevenx/design/simple/stylesheets/libs/fontawesome/css/all.min.css
extension/sevenx/design/simple/stylesheets/main.v02.css
extension/sevenx/design/simple/stylesheets/main.v02.res.css
JS0extension/ezjscore/design/standard/lib/yui/3.17.2/build/yui/yui-min.js
extension/ezjscore/design/standard/javascript/jquery-3.7.0.min.js
extension/community_design/design/suncana/javascript/jquery.ui.core.min.js
extension/community_design/design/suncana/javascript/jquery.ui.widget.min.js
extension/community_design/design/suncana/javascript/jquery.easing.1.3.js
extension/community_design/design/suncana/javascript/jquery.ui.tabs.js
extension/community_design/design/suncana/javascript/jquery.hoverIntent.min.js
extension/community_design/design/suncana/javascript/jquery.popmenu.js
extension/community_design/design/suncana/javascript/jScrollPane.js
extension/community_design/design/suncana/javascript/jquery.mousewheel.js
extension/community_design/design/suncana/javascript/jquery.cycle.all.js
extension/sevenx/design/simple/javascript/jquery.scrollTo.js
extension/community_design/design/suncana/javascript/jquery.cookie.js
extension/community_design/design/suncana/javascript/ezstarrating_jquery.js
extension/community_design/design/suncana/javascript/jquery.initboxes.js
extension/community_design/design/suncana/javascript/app.js
extension/community_design/design/suncana/javascript/twitterwidget.js
extension/community_design/design/suncana/javascript/community.js
extension/community_design/design/suncana/javascript/roadmap.js
extension/community_design/design/suncana/javascript/ez.js
extension/community_design/design/suncana/javascript/ezshareevents.js
extension/sevenx/design/simple/javascript/main.js

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/ezxmltext.tpl<No override>extension/community_design/design/suncana/templates/content/datatype/view/ezxmltext.tplEdit templateOverride template
8content/datatype/view/ezxmltags/paragraph.tpl<No override>extension/ezwebin/design/ezwebin/templates/content/datatype/view/ezxmltags/paragraph.tplEdit templateOverride template
4content/datatype/view/ezxmltags/literal.tpl<No override>extension/community/design/standard/templates/content/datatype/view/ezxmltags/literal.tplEdit templateOverride template
4content/datatype/view/ezxmltags/line.tpl<No override>design/standard/templates/content/datatype/view/ezxmltags/line.tplEdit templateOverride template
2content/datatype/view/ezimage.tpl<No override>extension/sevenx/design/simple/templates/content/datatype/view/ezimage.tplEdit templateOverride template
1pagelayout.tpl<No override>extension/sevenx/design/simple/templates/pagelayout.tplEdit templateOverride template
 Number of times templates used: 23
 Number of unique templates used: 7

Time used to render debug report: 0.0001 secs