How to remove the last character of a loop

Author Message

Brendan Pike

Thursday 05 August 2004 7:14:08 am

Could someone with stronger code skills please help resolve the issue preventing the vertical scroller adaption http://www.ez.no/community/contributions/template_plugins/vertical_latest_news_scroller from working in IE. The parsed loop results in the following format:
['href','text','target'],
['href','text','target'],
However the comma must be stripped from the last loop result for it to work. Ideas anyone?

www.dbinformatics.com.au

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

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}

Powered by eZ Publish™ CMS Open Source Web Content Management. Copyright © 1999-2014 eZ Systems AS (except where otherwise noted). All rights reserved.