Adding Custom Shortcode Replacements
Develop
Share this page:
Facebook
LinkedIn
Pinterest
Important: SetSeed caches page output for performance. When you are working with your CSS files and HTML templates you will want to disable the caching system so you can see your changes each time you refresh a test page in the browser. To do this, edit a page in the CMS and click 'Settings' in the toolbar. Then click the 'Enable page caching' toggle item to disable it.
Note: Where you see ~ in a file path, it refers to the current folder for a given website and assumes you are using global_design_mode_theme as the main theme with the theme_merge system for customisation. For example /sites/YOURSITE/theme_merge/settings/image_sizes.json is the same as ~/settings/image_sizes.json
You can create custom shortcode replacements for your themes using code like this:
[
{
"shortcode":"%"
,"replace": "<span style='color:#f00;'>%</span>"
}
]
Add that to a file called ~/settings/shortcode_replacements.json in the theme folder.
The % wildcard will be used to capture the user's text and insert it again in the replaced text.
You can add as many different replacements as you like to the json array.