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 31 2025 00:28:03
Script start
Timing: Jan 31 2025 00:28:03
Module start 'layout'
Timing: Jan 31 2025 00:28:03
Module start 'content'
Timing: Jan 31 2025 00:28:03
Module end 'content'
Timing: Jan 31 2025 00:28:03
Script end

Main resources:

Total runtime0.7783 sec
Peak memory usage8,192.0000 KB
Database Queries46

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0048 588.2500151.2266
Module start 'layout' 0.00480.0033 739.4766220.7188
Module start 'content' 0.00810.7693 960.19534,386.0938
Module end 'content' 0.77750.0008 5,346.28917.8281
Script end 0.7783  5,354.1172 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00370.4693160.0002
Check MTime0.00140.1839160.0001
Mysql Total
Database connection0.00080.101610.0008
Mysqli_queries0.701490.1161460.0152
Looping result0.00040.0450440.0000
Template Total0.724493.120.3622
Template load0.00210.265220.0010
Template processing0.722392.810520.3612
Template load and register function0.00120.159810.0012
states
state_id_array0.00240.308110.0024
state_identifier_array0.00210.268920.0010
Override
Cache load0.00170.2216350.0000
Sytem overhead
Fetch class attribute can translate value0.00170.223010.0017
Fetch class attribute name0.00150.188920.0007
XML
Image XML parsing0.00050.066710.0005
class_abstraction
Instantiating content class attribute0.00000.000420.0000
General
dbfile0.00090.1096160.0001
String conversion0.00000.001140.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