Shared Variables

Unlike Page Variables, a Shared Variable is not linked to any page, but instead, is available across the whole site. Therefore all Shared Variables get stored together in /shared/site.txt.
For example:

sitename: Awesome Site
-
theme: standard

Like Page Variables, also Shared Variables can be used anywhere in a template, except inside PHP blocks,
and must be wrapped in @s():

<!-- As an example, the sitename gets used as page title -->
<title>@s(sitename)</title>

Only alphanumeric characters, underscores "_", dots "." and dashes "-" are allowed in variable names!


Shared Variables And The GUI

As soon as you add a new Shared Variable, using @s(var) to any template of any installed theme, that variable automatically shows up in the GUI in the Site Settings / Shared Files pane.


Shared Variables As Parameters

Like Page Variables, also Shared Variables can be used as placeholder for any option value within tools and extensions.

A site-wide logo, linking to the homepage, could be added like this:

<div class="sitelogo">
    @t(img{ 
        file: @s(logo),
        width: 200,
        height: 200,
        crop: true,
        link: "/" 
    })
</div>
See also