Use replaceable text in custom templates
When you create a template, consider any text that needs to change whenever the template is used, which should display in a consistent format.
For example, in a module template, you may want to always show the module's title, code, and tutor at the top of the first page. You can help maintain this consistency by using replaceable text in your template. When someone creates a page or set of pages from your template, the replaceable text is substituted with new text entered by the person creating the page.
In this article:
Add or edit replaceable text
-
Browse to the site containing the custom template you want to edit.
-
Go to Edit > More:
-
On the Current site tab, select the template you want to edit under Site templates, then select the Edit button:
-
The SiteBuilder banner changes to green, denoting the transition to the template editor:
-
Select Edit replaceable text.
-
On the Replaceable text screen, select Create replaceable text:
-
You see the Create replaceable text for template pop-up:
-
Enter the Text to replace. All instances of this text in the template will be replaced by a term entered by the page editor. To avoid unintended replacements, use a unique term – for example:
xx_module_code
-
Enter brief Instructons for editors, to describe the purpose of the replaceable text. For example:
Entr your module code
-
To make the replaceable text Case sensitive, select the checkbox.
-
Use the radio buttons to specify whether you want to Replace text in page content (default) or Replace text in page content, title, headings and link captions.
-
Select Save
-
If necessary, you can add more replaceable text as required – for example, the module title and tutor. When someone selects your template from the gallery, they see an extra field for each piece of replaceable text alongside the instructions you specified.
-
When you've finished, select Done.
Edit or delete replaceable text
-
Browse to the site containing the custom template you want to edit.
-
Go to Edit > More:
-
On the Current site tab, select the template you want to edit under Site templates, then select the Edit button:
-
The SiteBuilder banner changes to green, denoting the transition to the template editor:
-
Select Edit replaceable text.
-
On the Replaceable text screen, you see a list of existing replaceable text:
-
Select the button for an entry to Edit or Delete it.
-
When you've finished, select Done.