Hi,
because in 3.6 they decided to do away with old template syntax in favor of a newer one which is more unified with common programming languages. 3.6 is back-compatible though, so you'll be able to use the syntax you're used to, and run your old code under it (shipped templates with 3.6 ARE using the old syntax, yet). but for new development tasks, I think you'll be better offusing the newer syntax.
hi,
you are saying here that the {section -construct should be avoided in the future. since i'm relativly new to exponential 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?
An example of using a foreach loop instead of the deprecated section?
Hi. Could someone provide an example of how to use a foreach loop instead of the deprecated section loop. Let's say I have the following code and want to use a foreach loop instead of a section:
This documentation stores what it needs to work: a session cookie when you sign in or keep a setting such as the help menu shown or hidden, the design you chose (Classic or Modern) and your language. Only if you agree, it also uses Google Analytics (through Google Tag Manager) to count visits; until then nothing is loaded from Google. Your choice is kept in a cookie for 6 months, and you can change it at any time under "Cookie settings" at the foot of every page. Details are in our Cookie Policy.
Always on
The session cookie for signing in and for forms, the cookies that keep your design and language, and the cookie that keeps this choice. They stay on because the website needs them; you can delete them in your browser settings at any time.
Google Analytics, loaded through Google Tag Manager (GTM-MPGWKTQV), counts visits and shows us which pages are read: the pages you open, the page you came from, your browser, device and screen size, and your approximate location derived from your IP address. Google processes the data for us and may transfer it to the USA. It sets the cookies _ga and _ga_* for up to 2 years. Off until you turn it on; when you turn it off again, Google is no longer loaded and these cookies are deleted.
Comments (4 historical)
Written by readers of the earlier documentation sites, kept as they were.
Section?
Joe ·
Where's the {section} command?
http://ez.no/ez_publish/documenta...plate_functions/program_flow/section
This is one of the most-used template control structures. Why isn't it here?
Re: Section?
Massimiliano Bariola ·
Hi,
because in 3.6 they decided to do away with old template syntax in favor of a newer one which is more unified with common programming languages.
3.6 is back-compatible though, so you'll be able to use the syntax you're used to, and run your old code under it (shipped templates with 3.6 ARE using the old syntax, yet). but for new development tasks, I think you'll be better offusing the newer syntax.
substitute for {section loop=..
patrick kaiser ·
hi,
you are saying here that the {section -construct should be avoided in the future. since i'm relativly new to exponential 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?
An example of using a foreach loop instead of the deprecated section?
Charles ·
Hi. Could someone provide an example of how to use a foreach loop instead of the deprecated section loop. Let's say I have the following code and want to use a foreach loop instead of a section:
<div class="listItem"> {default node_name=$node.name node_url=$node.url_alias} {foreach ( {section show=$node_url}<a href={$node_url|ezurl}>{/section}{$node_name|wash}{section show=$node_url}</a>{/section}{/default} </div>Thanks.