You can choose to create a snippet from scratch or to copy an existing snippet to use as a starting point.
Authors with the default Editor or Writer role can create snippets. If you're using a custom role, you'll need to have the Snippets custom author role permission to Add snippets.
To create a snippet from scratch:
- In the left navigation, select Snippets. The Snippets page opens.
- Select + Create New Snippet.
- Enter a Snippet Name. This is how the name will appear in the Snippets page and in snippet look-ups.
- The Merge Code Name will auto-generate from the Snippet Name, but you can edit it if you'd like to. The Merge Code Value is generated from the Merge Code Name. This is the value you'll enter in your articles, categories, or theme when you use the snippet.
- Enter a Snippet Description. This will help describe what your snippet does to other authors (and may help remind you if you forget). This description is only visible in the Snippets page and the Snippet Details pages.
- Enter your Snippet Content.
- If your snippet is used to display text (as our copyright is), type and format the text you want to display directly in the WYSIWYG Editor.
- For code-based snippets containing scripts or style tags, or for in-line text snippets, select the Snippet Content dropdown and select Code Editor. This toggles the editor to a simple code editor where you can enter raw HTML, scripts, CSS, and so on:
- Optional: In the right column, choose from these Visibility options:
- Hide from PDFs: This prevents the snippet from loading in PDFs. It's useful this is a script or other functionality that won't work in a PDF.
- Include snippet content in article blurbs: Article blurbs are used in search results and on category landing pages. If your snippet contains text content you want displayed, check this box. If it's a script, style, or other functionality, leave it unchecked.
- Optional: If you're using Reader Groups and only want this snippet to be visible to members of certain groups, check the boxes next to those groups in the Restrict to Reader Groups.
- Once you've finished formatting your snippet, select Create. Your snippet's created in the Snippets page and is available when someone tries to Insert Snippet in an article or category.