Keyword replacements and modifiers
Matrix provides you with a powerful and flexible way of referencing and changing how information stored in the system displays within the pages of your website:
Global keyword replacements
You can use global keyword replacements within various assets in the system to show different information about the asset within a global context. For example:
Display the current site a user is viewing with
Show a user’s username if the user is logged in with
Show the name of the page the user is currently viewing as a heading in a design with
Keyword replacements let you access an incredible amount of information about assets stored in your system, which you can use to build out content structures on your website frontend.
Keyword replacements can be used on the majority of assets, and let you access information such as the creation date of an asset, when an asset was last updated, or when the asset was last published.
See Keyword Replacements on Matrix Manuals for comprehensive reference documentation listing all available keyword replacements.
Keyword replacements can be modified using a variety of keyword modifiers to further configure the returned values.
These modifiers are represented as extensions added to existing standard keyword replacements, denoted by a caret (
^) character followed by the modifier keyword and any necessary modifier arguments.
For example, the keyword replacement
%asset_contents^maxwords:10% narrows the scope of the
%asset_contents% keyword by limiting the maximum number of words (
maxwords) to display to the first ten words contained within the body of the asset.
You can use multiple modifiers on a single keyword replacement, separated by the caret character.
%item_price^subtract:2\^multiply:10% subtracts two from the item price value before multiplying the new value by ten.
See Keyword Modifiers on Matrix Manuals for comprehensive reference documentation listing all available keyword modifiers.
You can install the free Matrix keyword helper bookmarklet to search all available keyword replacements and modifiers