MTTemplate 1.1
February 5, 2003
- updated February 8, 2006
(Download)
The MTTemplate tags enable you to verbatim display the entire contents or sections of MovableType templates in other templates. These tags are useful when documenting tips or showing template examples. In addition, the MTTemplateDynamic container tag allows you to use MTTags when posting entries.
The following example includes the pre-formatted contents of the template “Individual Archive” from the blog “Journal”:
<pre><$MTTemplateContents
template_name="Individual Archive" blog_name="Journal" escape_html="1"$>
</pre>
The following example declares a piece of the template as a snippet and then displays it as part of the text:
<MTTemplateSnippet name="navigator">
Pages (<$MTPaginateNumPages$>):
<$MTPaginateNavigator format_title="Page %d" format_all="All Pages"
format_current="<b>[ %d ]</b>" format_all_current="<b>[ All Pages ]</b>"
separator=" "$>
</MTTemplateSnippet>
...
Code for navigator:
<pre><$MTTemplateSnippetContents name="navigator"
template_name="Individual Archive" blog_name="Journal" escape_html="1"$>
</pre>
The following example allows MT tags to be interpreted in the text of an entry:
<MTTemplateDynamic>
<$MTEntryBody$>
</MTTemplateDynamic>
MTTemplateSnippet
A container tag that declares the contained text to be available via the MTTemplateSnippetContents tag. The MTTemplateSnippet tag does not affect how content is generated. If more than one MTTemplateSnippet tag is in a template, each must have a unique name attribute.
- name=”example”
Specifies the name of the snippet. This name is used in the MTTemplateSnippetContents tag to identify the snippet.
MTTemplateSnippetContents
Returns the contents of the specified template snippet. You must use either the template_id or template_name attribute to identify the template from which to include the snippet. You may specify a blog_name or blog_id attribute to use a template from another blog.
- name=”example”
Specifies the name of the snippet. This name is declared in the MTTemplateSnippet tag to identify the snippet.
MTTemplateDynamic
Container tag that allows MTTags to be processed in the text of an entry.
Example:
<MTTemplateDynamic>
<$MTEntryBody$>
</MTTemplateDynamic>