Free-Conversant Support / Macro: InsertTemplate
 Home   About Conversant   Free Sites   Hosting   Support   XML-RPC 

Search



Documentation >> Macros >> InsertTemplate

InsertTemplate Macro

The insertTemplate macro does exactly what you'd expect it to do: it inserts a specified template in place of the macro, at rendering time.

This macro has one special feature, however. It can insert a template from any conversation in the same zone. So if you want to maintain a common look across a number of conversations in the zone, just put your template "pieces" in one conversation, and use them anywhere.

Parameters

This macro has one required parameter, and one optional parameter.

  • name - required - the name of the template to be inserted

  • conversation - optional - the name of the conversation to pull the template from. If not provided, then the current conversation is used. Please see the second point in the notes, below.

Example

Here are two example uses of this macro:

<!--#insertTemplate name="sub template one"-->
<!--#insertTemplate name="sub template two" conversation="bleachers"-->

These are just examples. To use this macro in your site, replace the template name with the name of a template in your site, and replace the conversation name with the name of a conversation in your site. You can actually use the name of the current conversation if you want to, though it will act exactly the same as leaving the param out.

Notes

  • Templates are "compiled" into a format which allows Conversant to manipulate them quickly and easily. This makes it much more efficient to insert templates than it is to insert messages. However, Conversant's interface makes it a little easier to edit messages than it is to edit templates. The intent of this macro is to help you, the site administrator, to find a balance. We recommend keeping site structure in templates, and site content in messages.

  • Though templates can be inserted from any conversation, their macros and resources will still refer to the primary conversation: the one whose page or message is being rendered. In other words, in the second example above, if the "sub template two" template contained a macro that inserted message 5, it would use message 5 from this conversation, not message 5 from the "bleachers" conversation.

  • You might also want to look at the navbar macro, which will render any message through any (local) template.
View in DG