Using Sys.Eval() to force different translation scope

Release 1.3 - Release 1.4

In Smartsite iXperion 1.3, the Sys.Eval() viper method has been enhanced with new overloads for providing scope to translations being resolved in the given sys.eval() expression to evaluate. This gives you the ability to create SXML logic in the form of translation methods that can be subclassed by site builders by creating local or global copies of translations whose base-versions exist in a container folder (such as a Smartlet folder).

The basic syntax for enabling this is:

Smartsite SXML CopyCode image Copy Code
{sys.eval(my_translation(), testScope, fallbackScope)}

Where testScope is the 'public' scope to have the translation executed in if it is in scope there, but providing a 'safety net': if the translation is NOT in scope in testScope, it will be executed in fallbackScope.

Smartlet builders are encouraged to use this scope control mechanism, because it allows them to create very flexible applications that can be adapted to customer's needs easily without having to modify anything in a Smartlet itself.

Note that sys.eval() with explicit scoping has been deprecated in favor of Contextual Translation Scoping in 1.4.