A keyword replacement lets you print information about an asset within the site’s content. This information the keyword prints updates as the source information updates.
By using keyword replacements throughout your site, you can significantly reduce the need to update core information on your site manually.
Keyword replacements use the percentage (
%) symbol as a keyword marker, with a keyword value specified between the marker.
When the system finds a term between the
% markers, it validates against a known list of keyword replacements. It replaces the keyword with the correct information.
If the system can not match the keyword syntax, the content remains unprocessed.
If you use the keyword replacement
%asset_name%, the asset’s name appears where you set the keyword replacement.
If you change the asset’s name, the information displayed is updated instantly.
You can also use keyword replacements to display asset elements within the content. For example, when creating a custom form, you can use keyword replacements to layout the form.
Along with the keyword replacements for assets, there are global keywords. You can use these keywords on any asset within the system, including the Design asset. Global keywords show information such as the current asset the user is viewing, the current site they are viewing, or information from their user account (for users signed in to Matrix).
For example, suppose you want to show the asset’s name that the user is currently viewing within the design. In that case, you can use the global keyword
You can learn more about the available keyword modifiers by reading the Global keywords documentation.
You can modify the returned values of all keyword replacements by using keyword modifiers.
These modifiers are represented as extensions added to the existing keyword replacement using the
For example, suppose you want to show the first ten words from the content of a page. You can use the keyword replacement
%asset_contents%, combined with the modifier
^maxwords: to create the modified keyword of
You can learn more about the available keyword modifiers by reading the Keyword modifiers documentation.
Some keyword replacement prefixes are reserved for specific purposes. These prefixes include:
Take care when assigning field names and field values that could generate automatic keywords that conflict with these reserved keyword formats.