Because snippets give you so much flexibility, we strongly encourage you to incorporate them into:
- Your content auditing/review processes (Snippet references are a key feature for this process!)
- Your style guide
For style guide or snippet creation guidance, we've developed a checklist template for you to adapt.
Use this checklist either retroactively to clean up existing snippets or proactively as the basis for a snippet creation or review guide:
Snippet standardization checklist template
Use these steps to review existing snippets or create new snippets:
- Make sure all snippet names begin with the same case.
- The Snippets page sorts alphabetically AND IS CASE SENSITIVE. All snippets’ names beginning with an uppercase letter are sorted first, then all snippets’ names beginning with a lowercase letter. It’s a gift to your future self and other authors to use consistent case.
- Apply any additional naming conventions that make sense for you.
- For example, we begin all snippets that are designed specifically for use in our release notes with “Release Notes” in the name.
- Make sure your snippet Description describes what the snippet does.
- This Description is previewed in the initial Snippets display and is displayed in the Add Snippet modal to help authors determine if they've selected the correct snippet.
- Make sure your snippet Description describes where the snippet should be used.
- This provides great context for other authors inserting the snippet and can streamline future auditing. For example: "Use in individual articles/custom content categories." or "Use in category descriptions." or "Use only in Style > Custom HTML > Article."
- Make sure any code in the Snippet Content editor is commented.
- Add comments for general code functions for troubleshooting/future research around why a snippet’s used.
- If it’s a third-party integration, add a comment about where/how you got the code. This can make it easier for an author to upgrade to a new version at a future date.
- For snippets containing <style> sections, comment the CSS to describe what it’s doing.
- Create a snippet style guide/checklist or update the existing one with any changes.