browse.tpl enhancement - showing images

Author Message

Georg Franz

Friday 14 November 2003 6:26:17 am

Hi,

a suggestion for the
/design/standard/templates/content/browse.tpl

If you want to assign an image to a node (object relation or as related object), the browse-feature only show the name of the image and not the image itself. That's not user friendly because a user - in most cases - don't remember the name of the image. So it's easier to show the image additional to the name.

Insert following code in the browse.tpl:

Line 85:
Instead of

<img src={"class_2.png"|ezimage} border="0" alt="{'Document'|i18n('design/standard/node/view')}" />

New code:
----------

{section show=is_set($Object:item.data_map.image)}
<div align="imageleft">
{attribute_view_gui attribute=$Object:item.data_map.image image_class='small'}
</div>
{section-else}
{section show=is_set($Object:item.data_map.thumbnail)}
<div align="imageleft">
{attribute_view_gui attribute=$Object:item.data_map.image image_class='small'}
</div>
{section-else}
{section show=is_set($Object:item.data_map.icon)}
<div align="imageleft">
{attribute_view_gui attribute=$Object:item.data_map.icon image_class='small'}
</div>
{section-else}
<img src={"class_2.png"|ezimage} border="0" alt="{'Document'|i18n('design/standard/node/view')}" />
{/section}
{/section}
{/section}

Kind regards,
Emil.

Best wishes,
Georg.

--
http://www.schicksal.com Horoskop website which uses eZ Publish since 2004

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 15 2025 12:48:45
Script start
Timing: Jan 15 2025 12:48:45
Module start 'layout'
Timing: Jan 15 2025 12:48:45
Module start 'content'
Timing: Jan 15 2025 12:48:46
Module end 'content'
Timing: Jan 15 2025 12:48:46
Script end

Main resources:

Total runtime0.3565 sec
Peak memory usage4,096.0000 KB
Database Queries46

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0042 597.1563151.2188
Module start 'layout' 0.00420.0021 748.375036.6797
Module start 'content' 0.00630.3496 785.0547857.5000
Module end 'content' 0.35590.0006 1,642.55477.7188
Script end 0.3565  1,650.2734 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00300.8283160.0002
Check MTime0.00120.3483160.0001
Mysql Total
Database connection0.00050.149210.0005
Mysqli_queries0.314988.3248460.0068
Looping result0.00030.0879440.0000
Template Total0.335094.020.1675
Template load0.00220.603620.0011
Template processing0.332893.354220.1664
Template load and register function0.00150.420110.0015
states
state_id_array0.00060.170010.0006
state_identifier_array0.00060.177020.0003
Override
Cache load0.00190.5214350.0001
Sytem overhead
Fetch class attribute can translate value0.00050.144710.0005
Fetch class attribute name0.00150.417920.0007
XML
Image XML parsing0.00050.142210.0005
class_abstraction
Instantiating content class attribute0.00000.001120.0000
General
dbfile0.00060.1793160.0000
String conversion0.00000.002240.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
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
6content/datatype/view/ezxmltags/paragraph.tpl<No override>extension/ezwebin/design/ezwebin/templates/content/datatype/view/ezxmltags/paragraph.tplEdit templateOverride template
5content/datatype/view/ezxmltags/line.tpl<No override>design/standard/templates/content/datatype/view/ezxmltags/line.tplEdit templateOverride template
1print_pagelayout.tpl<No override>extension/community/design/community/templates/print_pagelayout.tplEdit templateOverride template
 Number of times templates used: 15
 Number of unique templates used: 6

Time used to render debug report: 0.0001 secs