Snippet

Plans supporting content reuse

Professional
Business
Enterprise






Snippets is a predefined set of content blocks the content manager or author uses as reusable content. The Snippet's content can vary from simple text or phrases to lengthy paragraphs, tables, images, and more. In Document360, the snippets are stored in a library, and you can easily insert them into articles during editing with just a click of a button.

NOTE

The Snippet will appear as regular content to the reader on the Knowledge Base site. The reader will not know that the content was rendered through Snippet.


Creating a snippet

To create a snippet,

  1. Navigate to Documentation () > Content tools > Content reuse > Snippets in the knowledge base portal.

    The Snippets page appears. If you have added any snippets earlier, you can see them listed here.

  2. Click Create snippets at the top to select language-specific snippets (Global, English, French, etc.) added to your project.

  3. Enter the Name for your snippet.

    NOTE

    The snippet name can include letters, numbers, hyphens, and underscores, with a maximum length of 30 characters.

  4. The Merge code value will be the snippet name that appears with the snippet tag in your editor.

    For example, if your snippet name is Disclaimer, then your Merge code value would be {{snippet.Disclaimer}}.

  5. In the Language selection dropdown, the default selection is Global (Available across all languages). However, if needed, you can choose a desired available language to create a language-specific snippet.

  6. In the Content field, enter the snippet's content.

    By default, the snippet editor will be WYSIWYG (HTML). However, you can switch to the Markdown editor if required.

NOTE

Switching to Markdown:

  1. Click Switch to Markdown.

  2. Click Proceed in the Change confirmation prompt.

You will lose the WYSIWYG content when you switch to Markdown.

  1. Once done, click Create snippet.

Adding a new snippet in the Knowledge base portal

Formatting options

WYSIWYG

The below formatting options are available for snippet content in WYSIWYG:

1_Screenshot-Formatting_options_available _in_snippet

  • Basic text formatting options such as Bold, Italic, Strikethrough, and Underline are available.

  • Additional formatting options include Font size, Font Family, Text color, Background color, Subscript, Superscript, and Clear Formatting.

  • You can create Ordered and Unordered Lists for listing items.

  • Insert Image allows you to insert an image from a URL, local storage, or Drive.

  • Insert Link lets you add a hyperlink from a provided URL or link to a knowledge base article.

  • You can use Insert callouts such as Info, Warning, Error, and Success.

  • Insert latex lets you add expressions and equations:

    • Click the Insert latex option, and an Insert latex expression panel will appear.

    • Type your desired Latex syntax and click Insert.

    • Read this article for basic Latex commands used in Latex syntax.

  • Insert table allows you to create a table by selecting the required number of rows and columns.

  • Insert codeblock lets you add codeblocks.

    • Click Insert codeblock and select the language of the desired code from the dropdown.

    • Add code in the Insert your code field and click Insert.

  • You can preview the Snippet in Code view (HTML). Click Code view to view the preview. If you want to switch back to the editor view, click Code view again.


Markdown

Markdown is handy when significant text and minimal media are involved in the Snippet. You can use Markdown syntax manually while writing or formatting text using the Markdown toolbar.

For example, you can make a text appear bold by writing the respective syntax or using the Bold () icon in the Markdown toolbar.

13_Screenshot-Makdown_options_available _in_snippet

  • Basic text formatting options such as Bold, Italic, Strikethrough are available.

  • Block quote lets you add block quotes.

  • Line lets you insert a horizontal line.

  • Ordered List and Unordered List are available for listing items.

  • Insert Table allows you to create a table by selecting the required number of rows and columns.

  • Insert Image allows you to insert an image from a URL, local storage, or Drive.

  • Insert Codeblock lets you add code blocks:

    • Click Insert Codeblock and type the desired code inside the code block.

    • Example: `code`.

  • You can use Insert callouts such as Info, Warning, Error, and Success.

  • Insert latex lets you add expressions and equations.

    • Click the Insert latex option, and a sample latex syntax () will appear.

    • Type your desired syntax.

    • The syntax must start and end with $.

NOTE

When adding latex, do not include a space between $ and syntax. For more information, read this article for basic latex commands.

  • Insert Link allows you to add a hyperlink from a provided URL or link to a knowledge base article.

  • Glossary lets you add glossary terms to your Snippet.


Using snippet in the article

There are two methods by which you could add a snippet to your article.

Method 1: Using the syntax (Markdown editor)

In the Markdown editor, type a snippet.MergeCodeValue between closed double curly brackets.

Example: {{snippet.Disclaimer}}

You must know the exact merge code value to add the desired snippet. The snippet will not work even if a single letter changes.

NOTE

Typing in snippet.Merge_Code_Value will only work in the Markdown editor. If you are using Advanced WYSIWYG editor, you can insert snippet using the toolbar.

Method 2: From the toolbar (Markdown, WYSIWYG, and Advanced WYSIWYG)

  1. Click on Content reuse () for Markdown and WYSIWYG editor.
    For the Advanced WYSIWYG editor, click on Insert > Snippets, or using the slash "/" command you can access snippets.

  2. Select the snippet or use the Search snippets bar to narrow down the snippet name.

In the Advanced WYSIWYG editor, the Snippets pane appears on the right for snippet selection. Hover the pointer on the snippet name to preview its content.

  1. Select the intended snippet to insert.

NOTE

If the Insert as local copy toggle is on, the snippet content added to the article will remain unchanged. The snippet in the article will not be affected if the selected snippet's content is modified or removed in the future.

Inserting snippets in the article in the Knowledge base portal.


Snippet overview page

You can view, edit, or delete a snippet on the Snippets page.

  1. Navigate to Documentation () > Content tools > Content reuse > Snippets in the knowledge base portal.

    The Snippets page appears where you can find the list of snippets you have already added.

Explaining the Snippet overview page

  1. Languages: To filter the snippet in Global or a specific language.

  2. Search snippets: Search the snippet list based on the name.

  3. Used in: If a snippet is not added to any article/category page, the status would be -. If a snippet is added to any article/category page, you can click the View button to see the list of articles/category pages containing the snippet.  

  4. Language: The desired language of each snippet.

  5. Last modified: The last time the snippet content was updated.

  6. Preview: Click on the snippet name, and you can view the snippet's content.

  7. Progress: Click the globe icon to view the snippet’s progress in multiple languages.

  8. Edit () icon: To edit the snippet content.

  9. Delete () icon: To remove the snippet.


View article/category page dependency

In the Snippets page, you can find the Used in column.

  1. In the Used in column, click on the View button.

    The View references panel will appear, where you can view the list of articles/category pages to which the snippet has been added.

  2. Click on the article to expand the section.

  3. You can find the following information:

    • The article version.

    • The project workspace and language.

    • The team account name and profile picture who has added the snippet.

    • The article states (Published, Draft, New Article).

    • The time/date information when the snippet was inserted in the article/category page.

Viewing the dependencies of snippets


Editing an existing snippet

  1. Navigate to Documentation () > Content tools > Content reuse > Snippets in the knowledge base portal.

    The Snippets page appears. You can find the list of snippets you have already added.

  2. Hover over the desired snippet and click the Edit () icon.

  3. After you complete the content edit, click on the Update button.

NOTE

When you update a snippet in the library, the changes are automatically reflected in all articles and category pages that use it. This includes published articles, which will be updated without needing to republish them.

Editing the existing snippets


Deleting a snippet

  1. Navigate to Documentation () > Content tools > Content reuse > Snippets in the knowledge base portal.

    The Snippets page appears. You can find the list of snippets you have already added.

  2. Hover over the desired snippet and click the Delete () icon.

  3. Click Yes in the confirmation prompt.

To bulk delete multiple snippets

Select multiple intended snippets from the Snippets page and click the Delete option at the top of the list.

Deleting the snippets in the Knowledge base portal


Translating snippets

You can create and manage snippets in multiple languages. This ensures that when your articles are translated, the snippets match the language of the article, providing a consistent and localized user experience.  

NOTE

Global snippets cannot be translated.

Translating new snippets

  1. Navigate to the Documentation () > Content tools > Content reuse > Snippets in the knowledge base portal.

  2. Click Create snippet.

  3. In the Language dropdown, select the intended language.

  4. Enter the snippet name and the content for the snippet in English (or your default language).

  5. Click Switch to markdown to change the content editor from WYSIWYG to the Markdown editor.

  6. To translate the content into other languages, click the Translate to other languages dropdown.

  7. Select the desired language(s) from the dropdown menu and click Translate.

NOTE

  • The default language will be marked as Main.

  • Translated languages will be indicated with a green tick to show that the translation is complete. If needed, you can navigate to untranslated languages and complete their translation.

  1. Once the translations are complete, click Create snippet to save the snippet along with its translations.

For example, if you create a snippet for a welcome message in English, you can use the translation feature to add the same message in French, Spanish, German, etc.

Translating the snippets in the Knowledge base portal

Translating existing snippets

  1. Click the desired existing snippet you wish to translate.

  2. Navigate to Translate to other languages and select the desired language that the snippet needs to be translated.

  3. Click Translate.

  4. If needed, you can navigate to other languages and again translate into those languages.

  5. To translate the content again, click Translate again. This will overwrite the existing translation with a new one.

  6. If you need to remove the translated snippet for a specific language, click Remove language.

    You can retranslate the content at any time if needed.

Translating the existing snippets


FAQs

How many snippets can be created in one project?

You can create up to 200 snippets in a single project. If you need more, additional snippets can be purchased as an add-on.

Can I change the name of a snippet after it has been created?

While you can edit the contents of a snippet, its name cannot be changed after creation.

Why is a snippet inserted in a new line?

Snippets are designed as new blocks of content, allowing for multiple lines to be added within them. As such, they will always start from a new line to maintain structure and clarity.