Path

7x / documentation / exponential / technical manual / 5.x / templates / the template language / variable usage / set won`t always work; the...


Caution: This documentation is for Exponential, from version 3.x to 6.x.
For 5.x documentation covering Platform see Exponential Platform Documentation, for difference between legacy and Platform see 5.x Architecture overview.

Set won`t always work; the Scope parameter

If you try to use "set" in an inner scope, it will not update a variable outside that scope without the scope-parameter.

This won`t update the var:

{def $myVar = "one"}
{if (#some test that evaluates to true")}
{set $myVar = "two"}

This however, will:

{def $myVar = "one"}
{if (#some test that evaluates to true")}
{set $myVar = "two" scope="root"}

See this page for more info: http://ez.no/doc/ez_publish/techn...nce/template_functions/variables/set

Hope this saves someone a little time and frustration...

Cheers,
Kjartan


Anonymous User (22/01/2007 12:45 pm)

Anonymous User (22/01/2007 12:45 pm)


Comments

There are no comments.