- Name - The name of the template
- Type - The type of 'template' to create, either a Template or a Snippet
A Template wraps your content in a div with a unique id, which allows it to be identified. Templates can be replaced by other Templates or Snippets using the Template Manager.
Templates can have predefined variables in its content replaced by values defined in the Template Manager configuration - see .
Unlike Snippets, which can only be inserted into the article content at the current cursor position, Templates can affect selected content. The selected article content will be altered by whatever html is contained in the Template that has a class included in the Content Classes' list in the . For example, selected content will be given a yellow background by the following html in the Template:
Selected Content
Templates can also trigger Creation Date and Modified Date parameters defined in their content. For example, if a Template contains a span tag with a class of 'cdate', 'creationdate', or any one of the classes specified in the , this span tag will have the current time and date inserted into it when the Template is inserted into the article content, eg:
<span class="cdate"> </span>
will become
09/17/2007 09:05:54
The time and date format is editable in the .
The creation date is only set once, when the Template is first inserted, but the Modified Date will change whenever the article is modified.
Example of Template html
<div class="mceTmpl"> <p class="selcontent" style="background-color: yellow;">Selected Content</p> <p style="padding: 3px; color: #666; border: 1px solid #CCC;"> <strong>Editors Comment</strong> (<span class="cdate"> </span>)<br /> [Insert your comment here]</p> </div>
The Template above applied to this text:
Nam liber tempor cum soluta nobis eleifend option congue nihil imperdiet doming id quod mazim placerat facer possim assum. Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam nonummy nibh euismod tincidunt ut laoreet dolore magna aliquam erat volutpat. Ut wisi enim ad minim veniam, quis nostrud exerci tation ullamcorper suscipit lobortis nisl ut aliquip ex ea commodo consequat.
becomes:
Nam liber tempor cum soluta nobis eleifend option congue nihil imperdiet doming id quod mazim placerat facer possim assum. Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam nonummy nibh euismod tincidunt ut laoreet dolore magna aliquam erat volutpat. Ut wisi enim ad minim veniam, quis nostrud exerci tation ullamcorper suscipit lobortis nisl ut aliquip ex ea commodo consequat.
Editors Comment (09/17/2007 : 11:28:39) [Insert your comment here]
A Snippet is a chunk of html code. It is not editable / replaceable as Templates are, but can have predefined variables in its content replaced by values defined in the Template Manager configuration - see .
Snippets will replace selected content.
Example of Snippet html
This is just some <strong>code</strong>
|