Creating Generated Content Snippets
THESE PAGES ARE STILL UNDER CONSTRUCTION AND DO NOT NECESSARELY REFLECT THE CURRENT VERSION OF TÓPICO
You can define small generated content snippets through the Publishing tab. Learn the basics in the Generate small content snippets tutorial.
The reusable content group contains a Generated content grid that let you create small generated content snippets.
Using generated content
To setup a generated snippet, follow these steps.
- Select the type of search to perform on the source file;
- Select the position of the inserted content;
- Enter the text/XPath to search for in the collection in the Text column;
- Enter the text/XML to insert in the Content column.
When you publish your collection, the text/markup in the Content column will be inserted at the selected position.
An generated content example
In this document, tips and warnings are tagged with this makup:
<div class="tip"><p>Some tip content<./p></div> <div class="warning"><p>Some warning content.</p></div>
Which is displayed like this:
The tip content.
The warning content.
While these tags appear the same in the editor, the "Tip" and "Warning" labels are added automatically with the following generated content snippets.
Type | Position | Text | Content |
---|---|---|---|
Text | Before | <div class="tip"> | <div class="tiplabel">Tip</div> |
Text | Before | <div class="warning"> | <div class="warninglabel">Warning</div> |
The div.tiplabel and div.warning labels are then defined in the stylesheet with the following selectors:
div.tiplabel {color:#006400; margin-left:24px; margin-bottom:-28px; padding:4px; font-weight:bold; } div.warninglabel {color:#8B0000; margin-left:24px; margin-bottom:-28px; padding:4px; font-weight:bold;}
In the above selectors, a negative bottom margin compensate for the large margin that's assigned to the Tip and Warning elements.
THESE PAGES ARE STILL UNDER CONSTRUCTION AND DO NOT NECESSARELY REFLECT THE CURRENT VERSION OF TÓPICO