Reuse Small Content Snippets
In this tutorial, you'll learn how you can reuse small content snippets.
Reusing small content snippets makes it easier to centralize common text elements used in your publication.
Let's pretend you'd like to have the product name and the latest product version displayed at different places in your collection. You might be faced with these two challenges:
- You're not yet sure about the exact product name yet or it will likely change in the future;
- The version number will have to be kept up to date with the latest release.
Although you could easily solve the above issues with a folder search and replace through your favorite HTML editor, reusable snippets help you address this scenario in a much more flexible manner. Here's how to do it.
Create your content snippets
You first need to create your reusable snippet.
- Navigate to the Advanced tab;
- Add the following entries to the Reusable content snippets grid.
|my_product_name||Your product name|
|my_product_version||Your product version|
You're now ready to reuse these snippets in your collection.
Manually insert a content snippet
To insert the product name in your documents
- Type %my_product_name% (between two % signs, without spaces);(1)
- Publish your collection.
You can insert "%my_product_name%" and "%my_product_version%" anywhere you like and manage these entries from a centralized location.
Insert a content snippet through the drop down list
Registered users can also add content snippet tokens from the reusable content drop down list above the editor window.
To add a snippet token to a topic, follow these steps:
- Right click on the Snippets drop down list;
- From the popup menu, select ;
- From the drop down list, select my_product_name;;
- Save and publish your collection.