Last Item

Author Message

Bernhard Hyden

Monday 25 August 2003 8:24:31 am

Hi,
In my template I always add an <hr> at the end of the element. Sure, it works fine, but I don&acute;t want to show the <hr> at the last element. How can a solve this problem?

Thanks,
Bernhard

Jan Borsodi

Monday 25 August 2003 8:42:12 am

I'm not entirely sure I understand the problem, could you show the template code?

--
Amos

Documentation: http://ez.no/ez_publish/documentation
FAQ: http://ez.no/ez_publish/documentation/faq

Bernhard Hyden

Monday 25 August 2003 8:46:14 am

ok, this is the line, which is shown three times:
{attribute_view_gui attribute=$node.object.data_map.titel}
<br><hr>

when the last item is reached there should be only displayed:
{attribute_view_gui attribute=$node.object.data_map.titel}
without <br> and <hr>

I hope you understand ist better now ;-)

lg,
Bernhard

Jo Henrik Endrerud

Monday 25 August 2003 8:48:43 am

I assume that you are looping through an array and showing each element. To avoid some code to be run after the last element you should use the {delimiter} function

example:

{section loop=$myArray name=test}
do stuff here
{delimiter}<hr>{/delimiter}
{/section}

You can find more information about these kind of things here: http://www.ez.no/developer/ez_publish_3/documentation/development/libraries/ez_template/functions/section

Jo Henrik Endrerud | System Developer @ Seeds Consulting | http://www.seeds.no

Bernhard Hyden

Monday 25 August 2003 8:53:59 am

Thanks, it works great ;-)
bye,
Bernhard

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 11:29:59
Script start
Timing: Jan 18 2025 11:29:59
Module start 'layout'
Timing: Jan 18 2025 11:29:59
Module start 'content'
Timing: Jan 18 2025 11:30:00
Module end 'content'
Timing: Jan 18 2025 11:30:00
Script end

Main resources:

Total runtime1.0537 sec
Peak memory usage4,096.0000 KB
Database Queries65

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0053 589.2109152.6094
Module start 'layout' 0.00530.0023 741.820339.3906
Module start 'content' 0.00761.0445 781.2109590.4844
Module end 'content' 1.05220.0015 1,371.695312.2031
Script end 1.0536  1,383.8984 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00310.2953160.0002
Check MTime0.00130.1270160.0001
Mysql Total
Database connection0.00090.087910.0009
Mysqli_queries1.001795.0642650.0154
Looping result0.00060.0585630.0000
Template Total1.022797.120.5114
Template load0.00220.204220.0011
Template processing1.020596.855120.5103
Template load and register function0.00020.016510.0002
states
state_id_array0.00160.151210.0016
state_identifier_array0.00090.087320.0005
Override
Cache load0.00180.1729320.0001
Sytem overhead
Fetch class attribute can translate value0.00110.107230.0004
Fetch class attribute name0.00090.088860.0002
XML
Image XML parsing0.00070.062730.0002
class_abstraction
Instantiating content class attribute0.00000.000960.0000
General
dbfile0.00110.1030170.0001
String conversion0.00000.000540.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
5content/datatype/view/ezxmltext.tpl<No override>extension/community_design/design/suncana/templates/content/datatype/view/ezxmltext.tplEdit templateOverride template
7content/datatype/view/ezxmltags/line.tpl<No override>design/standard/templates/content/datatype/view/ezxmltags/line.tplEdit templateOverride template
9content/datatype/view/ezxmltags/paragraph.tpl<No override>extension/ezwebin/design/ezwebin/templates/content/datatype/view/ezxmltags/paragraph.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: 24
 Number of unique templates used: 6

Time used to render debug report: 0.0002 secs