Forums / Setup & design / array handling

"Please Note:
  • At the specific request of Ibexa we are changing this projects name to "Exponential" or "Exponential (CMS)" effective as of August, 11th 2025.
  • This project is not associated with the original eZ Publish software or its original developer, eZ Systems or Ibexa".

array handling

Author Message

Pascal France

Thursday 27 September 2007 2:24:23 am

Hi,

Here is my while loop:

{def $tableau=array()
     $i=0
     $NbImages=2}
{while lt($i,$NbImages)}
     {I want $i element of $tableau =$publicites.0.children[$i].data_map.image.content[original].url|ezroot}
{/while}

I don't know how to add the values into $tableau

Pascal

Ce qui embellit le désert c'est qu'il cache un puits... quelque part... (A. de Saint-Exupéry) - http://luxpopuli.fr/eZ-Publish

Łukasz Serwatka

Thursday 27 September 2007 3:16:52 am

Use append() tpl array operator:

Something like:

{set $tableau = $tableau|append( $publicites.0.children[$i].data_map.image.content[original].url|ezroot() )

Personal website -> http://serwatka.net
Blog (about eZ Publish) -> http://serwatka.net/blog

Pascal France

Thursday 27 September 2007 1:02:34 pm

Thanks Łukasz.
It works fine.

Pascal

Ce qui embellit le désert c'est qu'il cache un puits... quelque part... (A. de Saint-Exupéry) - http://luxpopuli.fr/eZ-Publish