Skip to the content
Documentation
Help Start
Reading in:
  • German: 9,075 of 9,075 pages
About the help in other languages
All help pages

Section (legacy)

Reading the old section function found in older templates (loop, sequence, show, section-else, namespaced variables like $Item:item) and converting it to foreach, if and def.

Download as PDF

Address: https://doc.exponential.earth/exphelp/viewer/help/designers/templates/section-legacy.md

On this page

Section (legacy)

This page is for designers who maintain older templates. {section} was the general-purpose loop and condition of early template versions; it still works (eZTemplateSectionFunction) and still appears in shipped templates. New templates use {foreach}, {if} and {def}.

Contents

  1. Reading it
  2. Converting it

Reading it

{section name=Child loop=$children}
    <li>{$Child:item.name|wash}</li>
{section-else}
    <li>{'None'|i18n( 'design/mytheme' )}</li>
{/section}
  • loop= the array (or a number: loop that many times).
  • name= a namespace; inside, the current item is $Child:item, the key $Child:key, the index $Child:index.
  • section-else runs when the array is empty.
  • show= makes the section a condition: {section show=$node.can_edit} ... {/section}.
  • sequence=, max=, offset=, {delimiter} work like their foreach counterparts.

Converting it

SectionModern
{section name=X loop=$list} ... $X:item{foreach $list as $item} ... $item
{section-else}{if $list|count}{foreach ...}{/foreach}{else}...{/if}
{section show=$cond}{if $cond}
{let a=1} ... {/let}{def $a=1} ... {undef $a}
$:item (current namespace)the loop variable

Convert a template completely, then compare the output of a few pages before and after.

Become an Exponential Partner

Partners share their information, provide funding, contribute back and develop the products with us, and that is how Exponential grows. A partner website and dashboard are planned for mid-2027: please become a partner today to speed up our growth rate and land new features faster.

Something wrong on this page? Report an error

Documentation license

This documentation is free documentation, licensed under the GNU Free Documentation License 1.3 or later.

Exponential Copyright © 1998-2026 Exponential Foundation and 7x