Plugins : MTTemplate 1.1 Feb 05 2003 | # | C:0

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>

  • MTTemplateVersion
    Returns the version number of the MTTemplate plugin.
  • MTTemplateComment
    Comments out a section of the template. Unlike when you use HTML comments <— HTML comment —> the text inside the MTComment tags will not be included in the generated document.
    Example:
    <MTTemplateComment>
    Documentation that you do not want to be included
    in documents generated from this template.
    </MTTemplateComment>
  • MTTemplateContents
    Returns the contents of the specified template. You must use either the template_id or template_name attribute to identify the template to include. You may specify a blog_name or blog_id attribute to use a template from another blog.
    • template_id=”3”
      Specifies the template by the template ID (unique across all blogs) used by MovableType. The template_id attribute overrides the template_name, blog_name and blog_id attributes. You can find a template’s ID by looking at the URL when editing the template:
      http://www.domain.com/mt/mt.cgi?__mode=view&_type=template&id=3&blog_id=2
      Example:
      <pre><$MTTemplateContents
              template_id="3" escape_html="1"$>
      </pre>
    • template_name=”Main Index”
      Specifies the template by the template name. If the template resides in another blog, you will also have to specify a blog_id or blog_name attribute.
    • blog_id=”2”
      Specifies the blog ID from which to load the template. By default the current template’s blog is used. The blog_id attribute overrides the blog_name attribute.
    • blog_name=”Journal”
      Specifies the blog name from which to load the template.
  • 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>
Version History
  • Version 1.1 - Mar 17 2003
    Added MTTemplateComment tag.
  • Version 1.0 - Jan 27 2003
    Initial release.
The site database appears to be down.