Movable Type Documentation > Appendices > Appendix: Template Tags

Include

Type: function

Includes a template module or external file at this point. One and only one of the following attributes must be specified:

Attributes:

  • module - The name of a template module in the current blog.
  • widget - The name of the widget in the current blog to include.
  • file - The path to an external file on the system. The path can be absolute or relative to the Local Site Path. This file is included at the time your page is built. It should not be confused with dynamic server side includes like that found in PHP.
  • identifier - For selecting Index templates by their unique identifier.
  • blog_id - Used to include a template from another blog in the system. Use in conjunction with the module, widget or identifier attributes.

Also, attributes given to this tag are locally assigned as variables when invoking the include template.

The contents of the file or module are further evaluated for more Movable Type template tags.

Example: Including a Widget

<mt:Include widget="Search Box" />

Example: Including a File

<mt:Include file="/var/www/html/some-fragment.html" />

Example: Including a Template Module

<mt:Include module="Sidebar - Left Column" />

Example: Passing Parameters to a Template Module

<mt:Include module="Section Header" title="Elsewhere">

(from the "Section Header" template module)

<h2><mt:var name="title"></h2>
This page was last updated on 2007-11-08, 19:18.  

1 User Contributed Notes

Matt Jacobs Author Profile Page said:

I'm not sure if it's supposed to, but I could not get identifier to work with multiblog using either the [mt:multiblog] tag or blogid/includeblogs in the [mt:include] tag.

Submit a User Contributed Note

User contributed notes are a great way to share the knowledge you have gained in using Movable Type.

If you have a technical question or problem, please visit Movable Type Support.

(If you haven't left a note here before, you may need to be approved by the site owner before your comment will appear. Until then, it won't appear on the entry. Thanks for waiting.)