7.5. Using Macros with Widgets

A macro is a special kind of marker you can enter into a text widget. When the widget is displayed on a web page, any recognized macros in the text are replaced with the text they represent.

For example, to include the current site title in a text widget, enter {{site:title}} when configuring the widget's Text field.

The following macros are provided by Perforce Chronicle:

{{baseUrl}}
The application base URL. This is most useful in module configuration files that need to include links. For sub-folder installations this is a relative path; otherwise it is empty.
{{site:title}}
Your site's title.
{{site:description}}
Your site's description.
{{site:branch}}
The current site branch.
{{site:theme}}
Your site's current theme.
{{theme:baseUrl}}
The active theme's base URL. This is most useful in theme configuration files that need to refer to specific theme resources.
{{user:id}}
The current user's id.
{{user:email}}
The current user's email address.
{{user:fullName}}
The current user's full name.
{{version}}
The full release string of the currently running Chronicle.
{{version:release}}
The release version of the currently running Chronicle.
{{version:patch}}
The release patchlevel of the currently running Chronicle.
{{version:date}}
The release date of the currently running Chronicle.

Additional macros may be provided by modules.

[Note] Macros Also Available in Content

The macros presented above may also be used in content, provided that a content entry's content type enables them. To use macros in content, ensure that each appropriate content type element's definition includes:

options.macros.enabled = true

Perforce Chronicle - Release: 2012.2/486814