run-once

Summary

Assures that the content of the block is run only once in a page view.

Usage

{run-once}
  {* tpl code *}
{/run-once}

Parameters

NameTypeDescriptionRequired

Returns

Description

Assures that the content of the block is run only once in a page view, it uses the current filename
and placement to figure this out. This can be useful if you want a text to appear once or a calculation
to be run once for included templates or loops. Requires an end tag.

Examples

In this example, "My header" will be printed only once

{let elements=array('element1', 'element2', 'element3')}

 {section loop=$elements}

   {run-once}

     My header<br/>

   {/run-once}

   {$item}<br/>

 {/section}

{/let}

Comments

log in or create a user account to comment.

Contents

Reference

Database diagram
Template operators
Template functions
    GUI
    Miscellaneous
       cache-block
       fetch_alias
       include
       ldelim
       literal
       rdelim
       run-once
    Program flow
    Variables
Data fetching
Modules
XML tags


Created

06/02/2004
2:20:35 pm
by Balazs Halasy

Last updated

17/02/2004
11:43:52 am
by Vidar Langseid

Authors

Balazs Halasy
Vidar Langseid



This page is part of the Exponential documentation. The documentation is available under the GNU Free Documentation License. All contributions will be released under the terms of this license.