This task can be undertaken by users with the following roles: OC Developer and OC System Administrator.
On your site, you will find many pieces of text that are coded into the content types and templates. These text areas use text snippets to control what they display. For example, the text within "View more..." buttons, search bars, and search filters use text snippets.
You can add variants to specific text snippets to edit them, so you can make your site more accurate and user-friendly, or so you can apply different wording for different scenarios. You can also use text snippets to ensure that they appear correctly in multiple languages.
Some common uses of text snippet variants are:
- Editing the default search bar text
- Customizing search filters on listing pages
- Adding language variants for popular pages
If you suspect some text on your site is a text snippet, go to More > Text Snippets and use the search function to search for the snippet.
Check out this video to learn how to edit text snippets:
Add a variant for a text snippet
When adding variants to text snippets, you create them based on specific scenarios, such as the site type, content type, template, or particular pages. Here's how to do it:
- From the main menu, go to More > Text Snippets.
- Use the search bar to Search by name or text, and select the snippet you want to edit from the list. You can't edit the Name or any System defaults, but you can add a variant.
- Select Add Variant.
- From the Based on dropdown menu, select whether you want to add the variant based on the Site type, site, content type and/or template, or if you want to add it based on A specific page.
- If you're basing it on a page, start typing the Page name into the When the page is predictive text field and select it from the list.
- If you're basing the variant on a Site type, site, content type and/or template, use the further options to narrow down the scenario. For example, if you want to change the "Event Snapshot" text for an event page on your Theatre subsite, you would use the following settings:
- Based on: Site type, site, content type and/or template
- When the site type is: Subsite
- And the site is: Theatre
- And the content type is: OC Event
- And the template: Any
- Enter the text you want to display in the Show field. If you have multiple language packs, you'll need to add the text for each language.
- Select Add, then Save.
Check a page with the altered text snippet to ensure it's displaying correctly when you're finished.
Different types of variants are weighted differently. The system default is overridden by your default (which is only applicable in text snippets you've created yourself), and your default is overridden by variants you add.
If you add multiple variants, the system will use them in order of specificity. For example, a variant that works from A specific page will be used first as it is the most precise. If you have multiple variants involving Site type, site, content type and/or template, the system will use the variant that specifies the template first, then the one specifying the content type, then the site, and lastly, the site type.
Create a text snippet
This task can only be undertaken by users with the following roles: OC Developer.
Developers can create text snippets for use on templates and listing pages they create themselves. Once you've made a text snippet, you can also add further variants as you need to. Here's how to make a text snippet:
- From the main menu, go to More > Text Snippets.
- Select Create Text Snippet.
- Enter a Name for your text snippet.
- Enter the text you want for each language installed on your site in the fields under Your default.
- When you're finished, Save your text snippet.
You'll now be able to select this text snippet when creating or editing a template.
Please note that any variants you create may be removed upon new product release if that release targets the area of the site on which the snippet displays. To avoid losing them, we recommend documenting what variants you add to which snippets, so they can be recreated if they get removed.