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.

eZ debug

Timing: Jan 19 2025 10:02:24
Script start
Timing: Jan 19 2025 10:02:24
Module start 'content'
Timing: Jan 19 2025 10:02:25
Module end 'content'
Timing: Jan 19 2025 10:02:26
Script end

Main resources:

Total runtime1.4838 sec
Peak memory usage4,096.0000 KB
Database Queries183

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0072 589.1016180.8125
Module start 'content' 0.00731.3439 769.9141478.7891
Module end 'content' 1.35110.1326 1,248.7031333.0547
Script end 1.4838  1,581.7578 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00420.2861210.0002
Check MTime0.00160.1108210.0001
Mysql Total
Database connection0.00080.054510.0008
Mysqli_queries1.411095.09461830.0077
Looping result0.00180.12441810.0000
Template Total1.449197.720.7245
Template load0.00190.128320.0010
Template processing1.447297.528120.7236
Template load and register function0.00020.010610.0002
states
state_id_array0.00230.154110.0023
state_identifier_array0.00110.074420.0006
Override
Cache load0.00160.1073220.0001
Sytem overhead
Fetch class attribute can translate value0.00160.106120.0008
Fetch class attribute name0.00070.048020.0004
XML
Image XML parsing0.00270.183220.0014
class_abstraction
Instantiating content class attribute0.00000.000320.0000
General
dbfile0.00790.5355270.0003
String conversion0.00000.000430.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
1content/datatype/view/ezimage.tpl<No override>extension/sevenx/design/simple/templates/content/datatype/view/ezimage.tplEdit templateOverride template
1content/datatype/view/ezxmltext.tpl<No override>extension/community_design/design/suncana/templates/content/datatype/view/ezxmltext.tplEdit templateOverride template
5content/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
1pagelayout.tpl<No override>extension/sevenx/design/simple/templates/pagelayout.tplEdit templateOverride template
 Number of times templates used: 13
 Number of unique templates used: 6

Time used to render debug report: 0.0002 secs