Forums / General / Last Item

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