default

Summary

Declares (and defines) a variable if it does not already exist.

Usage

{default [name=value1] [var1=value2] [var2=value3] [...]}
 ...tplcode
{/default}

Parameters

NameTypeDescriptionRequired
name string Namespace for all generated template variables no
var1 mixed Name of variable to define no

Returns

Description

Assigns the variables unless they are already assigned

Examples

example
This example will output "Variables: 42 (forty-two)", because the first variable was set before the
default statement.

{let var1=42 var2='forty-two'}

{default var1=53}

Variables: {$var1} ({$var2})

{/default}

{/let}

Comments

Log in or create a user account to comment.

Contents

Reference

Database diagram
Template operators
Template functions
    GUI
    Miscellaneous
    Program flow
    Variables
       append-block
       default
       let
       sequence
       set
       set-block
Data fetching
Modules
XML tags


Created

06/02/2004
2:23:24 pm
by Balazs Halasy

Last updated

18/02/2004
2:59:49 pm
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.