Create and Manage Snippets
Snippet creation and management is limited to level 9 and 10 users. Both snippets, and the categories used to sort them, are accessible from Content > Snippets.
CategoriesLink to this section
Selecting Content > Snippets shows you snippet categories. This view lists all snippet categories for the account. You can filter the categories by name, sort categories by name and number of snippets, and click on a category name to see the snippets inside it.
All snippets must belong to a category; therefore, you must have at least one category to make snippets.
Click the More Actions menu for a category for the following options:
- Rename: Renaming a category only changes its name and affects no other files.
- Delete: Deleting a category also deletes all snippets within that category. Deleting a snippet does not affect any pages, but the snippet file cannot be restored (short of making it again).
To make a new category:
- Navigate to Content > Snippets.
- Click +New.
- Give the category a name that indicates the type of snippets that are grouped within it. Commonly, categories group snippets by function, or by the type of site or page they should be placed on.
- Click Create.
ManageLink to this section
In Content > Snippets, click Snippets to see the list of snippets for the account.
Click More Actions for a snippet for the following menu options:
- Preview: Displays a preview of the snippet thumbnail image or code. The code may not accurately reflect the appearance of the snippet when added to a page, as styling has not been applied yet.
- Edit: Takes you to the edit view of the snippet.
- Snippet: Dropdown with two options, "Rename" and "Delete."
- Renaming a snippet only changes its name and affects no other files.
- Deleting a snippet is a permanent action, and the snippet cannot be restored unless it is made again. Deleting does not remove a snippet from pages it has been placed on.
CreateLink to this section
To make a new snippet:
- Navigate to Content > Snippets.
- Click Categories to see the snippets inside or Snippets.
- Click +New.
- Fill out the snippet information. It contains the following fields:
- Name*: The name for your snippet ought to indicate its function, such as "Two-Column Table" or "Block Quote."
- Category*: Select a category for your snippet to belong to.
- Thumbnail Image: Show content editors an image of how the snippet will appear on the page.
- Choose to upload a file from your computer or select a copy of a file from the staging server.
- Files copied from the staging server are independent and are not linked to the original file or the staging server.
- Provide a JPG or PNG image at a recommended size of 300px x 300px, with a size limit of 1MB.
- Choose to upload a file from your computer or select a copy of a file from the staging server.
- Available for All Sites?: Choose whether this snippet is available to use for all sites in the account or not. If you choose to limit it, select from the list of sites which site or sites it is available to.
- Available To: Select the group that can place this snippet on pages.
- Description: Add a short description of the snippet, such as what it's used for or where on a page it should be placed.
*Required.
- Write the snippet source code. Remember that when the snippet is placed on the page, it becomes part of the page's code and is affected by the WYSIWYG editor, which may remove certain kinds of markup. Therefore HTML is recommended.
- Snippets should not include server-side or client-side code. It is possible to include classes that are called by client-side and server-side code, however.
- When creating a snippet that contains an image, use the full path to the production server to be able to see the image when previewing a snippet.
- Click Create.
Once created, snippets do not need to be published. Additionally, editing a snippet does not affect pages on which the snippet was already placed.