StructrScript is the name of the internal scripting language that can be used in Template Expressions, Show Conditions and any of the attributes of HTML elements.

It is a simple interpreted scripting language that consists of keywords and functions. StructrScript has no control structures, it is interpreted like a fully functional language, although some of the Built-In Functions have side effects.


The following statements are typical examples for the use of StructrScript.

capitalize( the first letter of the name of the current space to uppercase.
if(equal(, 'index'), 'active', null)Outputs ‘active’ if the name of the current page is ‘index’, typically used in the class attribute of navigation elements to mark a link.
empty(me)Boolean expression to determine if the current request is made by an authenticated user, evaluates to false if no current user is set.
each(find('User'), print( the name of each user in the system the current user has read access to.


About this article
Last change 2017-05-04
Topics Structr 2.0