Forums / Setup & design / [SOLVED] Llink a thumbnail image to larger version

[SOLVED] Llink a thumbnail image to larger version

Author Message

Russell Michell

Wednesday 20 August 2008 6:13:34 pm

Hi guys,

I spent <b>so</b> long on this that I felt I ought to let you know how to do it. "It" being the seemingly simple task of attaching a link to an image which when clicked, opens a larger version of that image <b>without</b> any HTML or eZ interface or anything. Just the plain, unadulterated larger image.

FYI, I'm using 4.0.1-rc2

1). If you don't have it already, you'll need to override the default 'ezimage.tpl' for your design or extension. Copy it from...

<b>design/standard/templates/content/datatype/view/ezimage.tpl</b>

...and into your design or extension folder using the exact same directory and path structure. Ensure you clear the cache too. I have caching turned off, but still had to do this anyway before eZ recognised the new location of this template.

This template decides how the actual <img src="" blah... /> is rendered as HTML

<b>Tip:</b>

On the off chance you've not discovered it, you can view the source on an eZ site and the path to the template being used, is rendered within HTML comments so you can esily find out which template is currently being parsed, thus:

<!-- START: including template: extension/duty/design/ezwebin/templates/content/datatype/view/ezimage.tpl (design:content/datatype/view/ezimage.tpl) -->

...some HTML code...

<!-- STOP: including template: extension/duty/design/ezwebin/templates/content/datatype/view/ezimage.tpl (design:content/datatype/view/ezimage.tpl) -->

2). At the top of this template you'll see this:

{default image_class=large
         css_class=false()
         alignment=false()
         link_to_image=false()
         href=false()
         target=false()
         hspace=false()
         border_size=0}

Simply change

link_to_image=false()

to:

link_to_image=true()

That's it.

If anyone knows where this is documented, I'm all ears :-)

Russell Michell, Wellington, New Zealand.
We're building! http://www.theruss.com/blog/
I'm on Twitter: http://twitter.com/therussdotcom

Believe nothing, consider everything.