Share » Forums » Developer » How to remove the last character of a...

How to remove the last character of a loop

How to remove the last character of a loop

Thursday 05 August 2004 7:14:08 am - 4 replies

Author Message

Paul Borgermans

Thursday 05 August 2004 7:22:38 am

Hi Brendan

{delimiter} is your friend here:

modify article_listitem.tpl by removing the comma:

[{$node.url_alias|ezurl('single')},
'{$node.object.data_map.intro.content.output.output_text|striptags|trim}','_blank']

in your node_list.tpl change the loop as follows:

{section name=Node loop=$node_list sequence=array(bglight,bgdark)}
        {node_view_gui view=listitem content_node=$Node:item}
        {delimiter},{/delimiter}
    {/section}

hth

-paul

eZ Publish, eZ Find, Solr expert consulting and training
http://twitter.com/paulborgermans

Brendan Pike

Thursday 05 August 2004 7:40:25 am

Magic thanks Paul!

www.dbinformatics.com.au

We are always interested in hearing from experienced eZ PHP programmers and eZ template designers interested in contract work.

Lydie Soler

Tuesday 09 August 2005 8:02:06 am

Hi I have modified the loop in order to exclude some elements:

{section name=Node loop=$node_list sequence=array(bglight,bgdark)}
{if not(eq($Node:item.object.section_id,6))}
 
        {node_view_gui view=listitem content_node=$Node:item}
{delimiter},{/delimiter}
{/if}

    {/section}
	

but now the , is never printed....

Any idea???

Lydie Soler

Wednesday 10 August 2005 2:19:46 am

Hi,

well finaly I have found the solution so here it is...

{section name=Node loop=$node_list sequence=array(bglight,bgdark)}
{section-exclude match=$Node:item.object.section_id|eq(6)}
{node_view_gui view=listitem content_node=$Node:item}
{delimiter },{/delimiter}
{/section}

You must be logged in to post messages in this topic!

36 542 Users on board!

Forums menu