Display caption text in the ALT attribute of an image

Author Message

willy jansen

Thursday 23 September 2004 9:45:54 am

By default ezpubli displays the value of the field "name" in the ALT and TITLE attribute of an image.


    

I'd like to know if I can change this. I want it to display the value of the field "Caption"

I found out the template for this piece of code is
design/standard/templates/content/datatype/view/ezimage.tpl

{section show=$href}
 <a href={$href} 
  {section show=$target}target={$target}
  {/section}>
 {/section}
 <img src={$image.url|ezroot} 
width="{$image.width}" 
height="{$image.height}" 
{section show=$hspace}hspace="{$hspace}"{/section} 
border="{$border_size}" 
alt="{$image.text|wash(xhtml)}" 
title="{$image.text|wash(xhtml)}" />
{section show=$href}</a>
{/section}

So the value is the variable $image.text
But where can you define this variable?

Any suggestion that could lead to a solution would be very much appreciated.

Frederik Holljen

Tuesday 28 September 2004 2:21:50 am

The value of the "Alternative image text" is used here.

willy jansen

Tuesday 28 September 2004 2:28:36 am

i found an alternative way using the field "Alternative Image Text" as explained by Tony here:
http://www.ez.no/community/forum/setup_design/alt_tags_on_images
Thanks for the suggestions

willy jansen

Tuesday 28 September 2004 2:29:26 am

sorry frederik. just missed your hint :)
nice helmet

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

eZ debug

Timing: Jan 18 2025 22:23:22
Script start
Timing: Jan 18 2025 22:23:22
Module start 'layout'
Timing: Jan 18 2025 22:23:22
Module start 'content'
Timing: Jan 18 2025 22:23:23
Module end 'content'
Timing: Jan 18 2025 22:23:23
Script end

Main resources:

Total runtime0.7497 sec
Peak memory usage4,096.0000 KB
Database Queries60

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0065 589.2891152.6563
Module start 'layout' 0.00650.0033 741.945339.5078
Module start 'content' 0.00980.7384 781.4531516.8828
Module end 'content' 0.74820.0015 1,298.335912.1094
Script end 0.7497  1,310.4453 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00320.4317160.0002
Check MTime0.00130.1769160.0001
Mysql Total
Database connection0.00080.108410.0008
Mysqli_queries0.697393.0118600.0116
Looping result0.00070.0897580.0000
Template Total0.714995.420.3575
Template load0.00220.297320.0011
Template processing0.712795.063620.3564
Template load and register function0.00020.028810.0002
states
state_id_array0.00130.175710.0013
state_identifier_array0.00140.190520.0007
Override
Cache load0.00180.2429220.0001
Sytem overhead
Fetch class attribute can translate value0.00060.079120.0003
Fetch class attribute name0.00130.173050.0003
XML
Image XML parsing0.00080.103620.0004
class_abstraction
Instantiating content class attribute0.00000.001550.0000
General
dbfile0.00170.2274160.0001
String conversion0.00000.001740.0000
Note: percentages do not add up to 100% because some accumulators overlap

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

Time used to render debug report: 0.0001 secs