Forums / Setup & design / How <img /> tag is it created ?

How <img /> tag is it created ?

Author Message

Pascal France

Wednesday 07 March 2007 9:35:01 am

Hi,

When we use the Image class to add images in a gallery, the system use two templates to display the gallery:

override/templates/full/gallery.tpl

which calls this one:

design/base/override/templates/galleryline/image.tpl

that contains:

{attribute_view_gui attribute=$node.data_map.image image_class=gallerythumbnail
            href=$node.url_alias|ezurl}

And the result of this code is something like that:

<a href="/path/to/the/image"><img src="path/to/the/image.jpg" width="70"
height="47"  style="border: 0px;" alt="some text" title="some text" /></a>

Where do come from the <a> and <img> tags ? Because they are not in the two above templates ?

Regards

Pascal

Ce qui embellit le désert c'est qu'il cache un puits... quelque part... (A. de Saint-Exupéry) - http://luxpopuli.fr/eZ-Publish

Softriva .com

Wednesday 07 March 2007 10:25:46 pm

Check out this dir for anchor.tpl
design/standard/templates/content/datatype/view/ezxmltags

If you have an access to linux command line write this at the ezp dir and you will see all the image.tpl

find . -name image.tpl

Heath

Wednesday 07 March 2007 10:35:40 pm

Using 3.9 and the ezwebin design extension there are several different examples of the image.tpl template override.

# find /web/c/ezextensions/ezwebin/trunk/extension/ezwebin/ -name image.tpl

extension/ezwebin/design/ezwebin/override/templates/horizontallylistedsubitems/image.tpl
extension/ezwebin/design/ezwebin/override/templates/galleryslide/image.tpl
extension/ezwebin/design/ezwebin/override/templates/full/image.tpl
extension/ezwebin/design/ezwebin/override/templates/line/image.tpl
extension/ezwebin/design/ezwebin/override/templates/galleryline/image.tpl
extension/ezwebin/design/ezwebin/override/templates/embed-inline/image.tpl
extension/ezwebin/design/ezwebin/override/templates/listitem/image.tpl
extension/ezwebin/design/ezwebin/override/templates/embed/image.tpl

Using 3.9 and the base design resources only.

find design/ -name image.tpl

design/admin/override/templates/thumbnail/image.tpl
design/admin/override/templates/admin_preview/image.tpl
design/base/override/templates/galleryslide/image.tpl
design/base/override/templates/full/image.tpl
design/base/override/templates/line/image.tpl
design/base/override/templates/galleryline/image.tpl
design/base/override/templates/embed-inline/image.tpl
design/base/override/templates/pdf/article/image.tpl
design/base/override/templates/listitem/image.tpl
design/base/override/templates/datatype/ezobjectrelation/image.tpl
design/base/override/templates/textlinked/image.tpl
design/base/override/templates/embed/image.tpl
design/mysite/override/templates/image.tpl

hth

Brookins Consulting | http://brookinsconsulting.com/
Certified | http://auth.ez.no/certification/verify/380350
Solutions | http://projects.ez.no/users/community/brookins_consulting
eZpedia community documentation project | http://ezpedia.org

Pascal France

Thursday 08 March 2007 12:31:46 am

Hi,

I don't underdtand your answers.

To display a gallery, the system use 2 templates:

design/plain_site/override/templates/full/gallery.tpl
design/base/override/templates/galleryline/image.tpl

and no other. So, I don't think that finding other image.tpl templates will answer my question.

I wonder how this code:

{attribute_view_gui attribute=$node.data_map.image}

produces this output:

<img src="/path/to/the/image.jpg" width="360" height="240" style="border: 0px;" alt="some text" title="some text" />

In addition, if we use only these codes in design/base/override/templates/galleryline/image.tpl:

{href=$node.url_alias|ezurl}

or

{attribute_view_gui href=$node.url_alias|ezurl}

any output is produces. So it seems that another file is used to create the <img and <a tags and I just would like to know which it is.

Regards

Pascal

Ce qui embellit le désert c'est qu'il cache un puits... quelque part... (A. de Saint-Exupéry) - http://luxpopuli.fr/eZ-Publish

Esteban Rodriguez

Thursday 08 March 2007 5:23:28 am

Hi Pascal,

The attribute_view_gui function actually uses other templates which you can override too.
The standard templates for datatypes are in the following path:
"design/standard/templates/content/datatype/view"

For images you are using the ezimage.tpl template.

Hope it helps

I have great faith in fools; self-confidence my friends call it.

http://presencia.net

Heath

Thursday 08 March 2007 9:10:20 am

I've added an entry on eZpedia on this subject,
http://ezpedia.org/wiki/en/ez/attribute_view_gui

Brookins Consulting | http://brookinsconsulting.com/
Certified | http://auth.ez.no/certification/verify/380350
Solutions | http://projects.ez.no/users/community/brookins_consulting
eZpedia community documentation project | http://ezpedia.org

eZ debug

Timing: Jan 18 2025 15:15:52
Script start
Timing: Jan 18 2025 15:15:52
Module start 'content'
Timing: Jan 18 2025 15:15:53
Module end 'content'
Timing: Jan 18 2025 15:15:53
Script end

Main resources:

Total runtime1.2282 sec
Peak memory usage4,096.0000 KB
Database Queries207

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0051 587.7109180.8359
Module start 'content' 0.00511.0498 768.5469667.6406
Module end 'content' 1.05490.1733 1,436.1875341.0938
Script end 1.2281  1,777.2813 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00390.3171210.0002
Check MTime0.00150.1188210.0001
Mysql Total
Database connection0.00050.039610.0005
Mysqli_queries1.152693.84432070.0056
Looping result0.00190.15662050.0000
Template Total1.205098.120.6025
Template load0.00160.134220.0008
Template processing1.203497.975520.6017
Template load and register function0.00010.012110.0001
states
state_id_array0.00070.056110.0007
state_identifier_array0.00120.094520.0006
Override
Cache load0.00150.1200570.0000
Sytem overhead
Fetch class attribute can translate value0.00130.108550.0003
Fetch class attribute name0.00100.085380.0001
XML
Image XML parsing0.00150.120350.0003
class_abstraction
Instantiating content class attribute0.00000.001290.0000
General
dbfile0.00280.2286340.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
6content/datatype/view/ezxmltext.tpl<No override>extension/community_design/design/suncana/templates/content/datatype/view/ezxmltext.tplEdit templateOverride template
17content/datatype/view/ezxmltags/paragraph.tpl<No override>extension/ezwebin/design/ezwebin/templates/content/datatype/view/ezxmltags/paragraph.tplEdit templateOverride template
10content/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
3content/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: 42
 Number of unique templates used: 7

Time used to render debug report: 0.0002 secs