Forums / General / substitute for {section loop=... construct

"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".

substitute for {section loop=... construct

Author Message

Patrick Kaiser

Wednesday 13 July 2005 5:33:46 am

hi,
in the new documentation is stated that the {section -construct should be avoided in the future. since i'm relativly new to ez-publish i'd like to get used to the the 'right' ways of template programming right from the beginning. but i cannot find a way to loop over results from a fetch differently than the old {section loop=... way.

i tried it with 'while' and 'for' statments with no success..

what is best practice for looping over results using the new control structures?

thanks, patrick


Best regards,

Patrick

Frederik Holljen

Wednesday 13 July 2005 5:47:04 am

Use foreach:
{foreach $arrayVar as $variableName}
{$variableName}
{/foreach}