This content is currently unavailable in German. You are viewing the default (English) version.

What is a Snippet?

Snippet is a predefined set of content blocks that the content manager or author identifies as reusable content. The Snippet's content can vary from simple text/phrases to lengthy paragraphs, tables, images, and more.

In the Document360 Knowledge base portal, the snippets are stored in a library. You can insert the available snippets into Articles at the time of editing with a simple 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.


Adding a Snippet to the library

2_ScreenGIF_Adding New Snippet global language.gif

  1. Go to Content toolsContent reuseSnippet
  2. The Snippet overview page appears.

If you have added any snippets earlier, you can see them listed here

  1. Use the dropdown at the top to select language-specific snippets (Global, English, French, etc.)
  2. Click on the Add snippet button on the top-right
  3. Type a Name for your snippet

Name can only contain only letters, numbers, hyphen (-), and underscore ( _ )

  1. The Merge code value would be the actual tag that appears in your editor

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

  1. If you want that particular Snippet to be available across all the languages, turn on the Global toggle

By default, the Global toggle is enabled.

  1. If turned Off, you can select the available language from the Language dropdown, and the Snippet will be available only for that particular language
  2. The default snippet editor would be WYSIWYG (HTML).

However, you can switch to the Markdown editor if required.

Switching to Markdown

12_Screenshot-Markdown_option_snippets

  • Enable the Markdown toggle
  • Click Yes in the Change confirmation prompt
Limitation in switching to Markdown
  • You cannot switch back to WYSIWYG (HTML) for that Snippet
  • You will lose the WYSIWYG (HTML) content of that Snippet. You would have to type in the content manually again
  1. In the Content, add the content you want in the Snippet. You can find the available formatting options in the below section
  2. Click the Add button. The new Snippet is now available on the Snippets overview page

Formatting options available

WYSIWYG

1_Screenshot-Formatting_options_available _in_snippet

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

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

  • You can use the other formatting options such as Font size, Font Family, Text color, Background color, Subscript, Superscript, and Clear Formatting

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

  • You can use Insert Image to insert an image from the URL, local storage, or Drive

  • You can use Insert Link to add a hyperlink from a provided URL or a knowledge base article to the selected text

  • Insert callouts lets you add the below three formats

Info
Warning
Error
  • Insert latex lets you add expressions and equations
    10_Screenshot-Latex_expressions

    • Click the Insert latex option, and a Insert latex expression window appears
    • Type in your desired latex syntax and click Insert
    • Click here to view the basic latex commands used in latex syntax
  • Insert table lets you create a table by selecting the required number of rows and columns

header header header
  • Insert codeblock lets you add codeblocks. Click Insert codeblock → Select the language of the desired code from the dropdown → Add code in the Insert your code field → Insert

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


Markdown

Markdown is handy when significant text and mild 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.

Suppose you need a quick syntax reference while writing a snippet. In that case, you can view common Markdown commands right in the editor by clicking Shortcut on the bottom left of the screen.
13_Screenshot-Makdown_options_available _in_snippet

  • Basic text formatting options such as Bold, Italic, Strike 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 the items
  • Insert table lets you create a table by selecting the required number of rows and columns
header header header
  • You can use Insert Image to insert an image from the URL, local storage, or Drive

  • Insert codeblock lets you add codeblocks. Click Insert codeblock and type in the desired code inside the desired code between ```code```

  • Insert callouts lets you add the below three formats

Info
Warning
Error
  • Insert latex lets you add expressions and equations

    • Click on Insert latex option and a sample latex syntax () appears
    • Type in your desired syntax
    • The syntax must start and end with $

    Don't add a space between $ and syntax.

    • Click here to view the basic latex commands used in latex syntax
  • You can use Insert Link to add a hyperlink from a provided URL or a knowledge base article to the selected text

  • 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

Type in Snippet.MergeCodeValue between closed double curly brackets

*Example: {{snippet.warningline}}

But you must know the exact merge code value to add any snippet.

8_Screenshot-Inserting_Snippets_from_documentation_editor_MergeCodeValue

Not supported in the WYSIWYG editor

Typing Snippet.MergeCodeValue will only work if you use the Markdown editor.

If you're using the WYSIWYG editor, please follow Method 2 (mentioned below) to add a snippet to your article.

(or)

Method 2

  1. Click on { } Content reuse button in the Markdown or WYSIWYG editor and select the Snippet or use the Search snippets bar to search for the snippet name
  2. Select the desired snippet(s) from the search list
  3. Next, select whether you want the selected snippet(s) to be local by turning on the Insert as local copy toggle

7_Screenshot-Inserting_Snippets_from_documentation_editor

Local Snippet

If the Insert as local copy toggle is on, the snippet content added in the article will remain the same from here on. The Snippet in the article will not be affected if the selected Snippet’s content is modified/removed in the future.

  1. Click on the Insert button

Snippet overview page

You can view, edit, or delete a snippet from the Snippet overview page (Content tools → Content reuse → Snippet).

3_Screenshot_Snippet Overview Page.png

a. Language – To filter the snippets in Global or a specific language
b. Name – The Snippets are listed by Name and can be sorted
c. Documents used – If the Snippet hasn’t been used in any article, the status would be “-“.
If used in the knowledge base articles, you can click on the View button to see the list of articles/category pages that contain the Snippet.
For more information, see the below section
d. Edit - To edit the Snippet content
e. Delete - To delete the Snippet


View article/category page dependency

  1. In the Snippet overview page, you can find the column Documents used
  2. Click on the View button, and a dependency blade appears on the right
  3. On the blade, you can view the list of articles/category pages the Snippet has been used
  4. Click on the article/category to expand the section
  5. You can find the following information:
    • The article version and language
    • The team account's name and profile picture of who has inserted the Snippet
    • The article status (Published, Draft, New Article)
    • The time/date when the team account inserted the Snippet in the article/category page

4_Screenshot_Snippet Dependency viewer blade.png


Editing an existing snippet

5_Screenshot-Snippets_overview_page_edit_option

You cannot switch between editors in this section.

  1. Go to Content toolsContent reuseSnippet
  2. You can find the list of snippets you have already added
  3. Mouseover the snippet you want to edit and click the Edit (pencil) icon
  4. Update snippet appears on the right, and you can edit the content of the Snippet

Name and Merge Code Value cannot be edited.

Global

If the Snippet is not tagged in any article/category page, you can edit the global/local availability. If the Snippet is tagged in any article/category page, you cannot edit the global/local availability.

  1. Once you are done with the content edit, click the Update button
Snippet content change

When you edit the contents of an existing snippet in the library, the content change will reflect in all the articles/pages in which the respective Snippet has been inserted.


Deleting a snippet from the library

6_Screenshot-Snippets_overview_page_delete_option

  1. Go to Content toolsContent reuseSnippet
  2. You can find the list of snippets you have already added
  3. Mouseover the Snippet you want to delete
  4. Click the Delete(trashbin) icon
  5. Click Yes in the Delete confirmation prompt
Delete dependency

You cannot delete a snippet if you have any article/category page dependency. Suppose the Snippet has been used in one or more articles/category pages.

In that case, you must first manually remove the Snippet from those articles/category pages and then delete the Snippet.


Related videos

Smart way to manage reusable content blocks in your knowledge base


Related blogs

How to re-use your content with Snippets and Variables?