Need automatic ALT-tag to comply with standards..

Author Message

Valentin Svelland

Tuesday 22 March 2005 3:12:30 am

I'm still running eZp 3.2-6 and need the ALT-tag to always be set to title of associtated article if exists, or else the image name.

Been playing around overriding the templates\image\imageobject.tpl without any luck so far.

Any of u hardcore programmers got a hint here? Tnx.

------------------------
I made eZ run on www.eigersund.kommune.no, bjerkreim.kommune.no, lund.kommune.no and sokndal.kommune.no. Municipalities should use open source!

Bård Farstad

Wednesday 23 March 2005 1:53:21 am

Valentin,

try looking at the template (or your override template) for the image datatype:
design/standard/templates/content/datatype/view/ezimage.tpl

--bård

Documentation: http://ez.no/doc

Valentin Svelland

Monday 28 March 2005 2:28:49 pm

Thanks, most helpful. Still I'm having trouble fetching the name of the image to fit into the alt-tag as you can see at the end of the longest line in this code (override/templates/content/datatype/view/ezimage.tpl):

{section show=and(first_set($attribute.content,true()),first_set($attribute.content.contentobject_attribute_id,false()))}
  {default image_class=original
           alignment=false()
           hspace=false()
           border_size=0}
  {let image_content=$attribute.content
       image=$image_content[$image_class]}
     <img src={$image.full_path|ezroot} width="{$image.width}" height="{$image.height}" {section show=$hspace}hspace="{$hspace}"{/section} {section show=$alignment}align="{$alignment}"{/section} border="{$border_size}" alt="{* I WANT TO PUT IN IMAGE NAME HERE*}" />
  {/let}
  {/default}
{/section}

------------------------
I made eZ run on www.eigersund.kommune.no, bjerkreim.kommune.no, lund.kommune.no and sokndal.kommune.no. Municipalities should use open source!

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 19 2025 09:59:48
Script start
Timing: Jan 19 2025 09:59:48
Module start 'layout'
Timing: Jan 19 2025 09:59:48
Module start 'content'
Timing: Jan 19 2025 09:59:49
Module end 'content'
Timing: Jan 19 2025 09:59:49
Script end

Main resources:

Total runtime0.6708 sec
Peak memory usage4,096.0000 KB
Database Queries57

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0047 589.2891152.6406
Module start 'layout' 0.00470.0028 741.929739.4922
Module start 'content' 0.00750.6616 781.4219541.3984
Module end 'content' 0.66910.0016 1,322.820312.1250
Script end 0.6707  1,334.9453 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00310.4575160.0002
Check MTime0.00130.1975160.0001
Mysql Total
Database connection0.00070.103610.0007
Mysqli_queries0.619292.3136570.0109
Looping result0.00070.0995550.0000
Template Total0.643395.920.3217
Template load0.00190.282220.0009
Template processing0.641495.624220.3207
Template load and register function0.00030.041310.0003
states
state_id_array0.00110.159710.0011
state_identifier_array0.00090.127720.0004
Override
Cache load0.00150.2259170.0001
Sytem overhead
Fetch class attribute can translate value0.00070.107520.0004
Fetch class attribute name0.00120.175850.0002
XML
Image XML parsing0.00320.479420.0016
class_abstraction
Instantiating content class attribute0.00000.001660.0000
General
dbfile0.00430.6442230.0002
String conversion0.00000.001240.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
3content/datatype/view/ezimage.tpl<No override>extension/sevenx/design/simple/templates/content/datatype/view/ezimage.tplEdit templateOverride template
3content/datatype/view/ezxmltext.tpl<No override>extension/community_design/design/suncana/templates/content/datatype/view/ezxmltext.tplEdit templateOverride template
4content/datatype/view/ezxmltags/paragraph.tpl<No override>extension/ezwebin/design/ezwebin/templates/content/datatype/view/ezxmltags/paragraph.tplEdit templateOverride template
1content/datatype/view/ezxmltags/line.tpl<No override>design/standard/templates/content/datatype/view/ezxmltags/line.tplEdit templateOverride template
1content/datatype/view/ezxmltags/literal.tpl<No override>extension/community/design/standard/templates/content/datatype/view/ezxmltags/literal.tplEdit templateOverride template
1print_pagelayout.tpl<No override>extension/community/design/community/templates/print_pagelayout.tplEdit templateOverride template
 Number of times templates used: 14
 Number of unique templates used: 7

Time used to render debug report: 0.0001 secs