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

Powered by eZ Publish™ CMS Open Source Web Content Management. Copyright © 1999-2014 eZ Systems AS (except where otherwise noted). All rights reserved.