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.

advanced tab screen capture

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.

  1. Select the type of search to perform on the source file;
  2. Select the position of the inserted content;
  3. Enter the text/XPath to search for in the collection in the Text column;
  4. 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:

XML
			<div class="tip"><p>Some tip content<./p></div>
			<div class="warning"><p>Some warning content.</p></div>
		

Which is displayed like this:

Tip

The tip content.

Warning

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:

CSS
			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.

Learn more about generating content.

THESE PAGES ARE STILL UNDER CONSTRUCTION AND DO NOT NECESSARELY REFLECT THE CURRENT VERSION OF TÓPICO

149 / 194