Developing Custom Themes / Custom Themes Advanced Topics |
This topic describes how to make advanced phrase substitutions.
To understand how phrase substitution works, you might find it helpful to read Simple Phrase Substitution in the UI.
On the Phrase Substitution Rules page (Edit Rules.)
), you can change the rule or get more information about it. (You can also get to this page from the page by editing a theme and then clickingWhen you need more fine-grained control over your substitution, you can create an advanced rule. You can do this in the Admin Console by editing the custom theme with which the new rule will be associated. In the console, click Edit Rules. On the Phrase Substitution Rules page, click Add Rule.
, then click the edit icon for the theme to which you want to add the rule. On the Edit Theme page, clickRule Option | Value | Description |
---|---|---|
Target | Value or Key | Whether the rule should be looking for your pattern (what you're replacing) in the i18n values or keys. If you choose "Key" here, the substitution will still be for the key's value, not the key itself. This is handy when you know what a particular key is and want to focus on that one in particular. |
Operator | Equals, Contains, Starts With, Ends With, or Regular Expression. | The first four values are self-explanatory. The last specifies that your pattern is a "regular expression". |
Pattern | The original string. | The pattern that should be sought for replacement. For example, if you'd specified "Regular Expression" as your operator, you could enter "\bblog\b" for a pattern that matches the word "blog" (as opposed to "blogger"). The "\b" combination in regular expression can be used to indicate the boundary of a word. |
Replace With | The replacement string. | The text to substitute instead of the text you enter for a pattern. |