Chapter 3: Templates and Layout
Editing a Template
Problem
You want to create or edit a template for your weblog.
Solution
Use the template management screen.
Discussion
Movable Type automatically installs a number of default templates when a weblog is created. These templates are fine for getting started quickly; however most users will want to customize the templates to suit their own tastes and needs.
In order to edit a template, click the Templates button in the Weblog Toolbar to get to the Templates Listing Screen. The screen is divided up using tabs, one for each template type. Find the template and click on its name to bring up the Edit Template Screen.
The Edit Template Screen has a number of fields for editing the template and its attributes. Here are all of the fields you may see on the screen. Depending on the template type some fields may not be present.
- Name
The name of the template used for identification purposes in the Templates Listing screen. The template name cannot be edited on System templates.
- Output file
When editing an index template, you must specify a filename where the output of the template will be stored. For example, the output file for your Main Index template might be index.html.
The output file applies only to index templates. It can be either a path (eg. file.html) that is relative to your Local Site Path, or a full path from the root of the local filesystem (eg. /full/path/to/file.html).
- Rebuild this template automatically
When editing an index template, you have the option of automatically rebuilding the template each time you save an entry or rebuilding in batch. Generally, you should stay with the default option of rebuilding an index template automatically. There are times when you do not need to rebuild an index template automatically. For example, perhaps you are using index templates to manage primarily static content. In cases like this, you will want to turn off automatic rebuilding of static index templates, because it needlessly slows down the publishing of new entries.
If automatic rebuilds are switched off, the only way to rebuild the template will be by clicking the Rebuild action button on the Edit Template screen.
- Link this template to a file
Some users will find it easier to edit the template layouts in a text editor or web page design GUI like Adobe Go Live instead of through the Movable Type browser interface. You can optionally link a Movable Type template to an external file. This allows you to edit your templates while keeping the copy that is inside Movable Type synchronized with the external file.
See "Editing a Template using an External Editor" for more on how this works.
- Template body
The body of your template containing template tags and other markup such as HTML or XML.
Template tags are discussed throughout this chapter and others. See Appendix A for a complete list of the built-in tags included in MT.
Click the Save action button to store your changes in the MT database.
Creating a New Template
Creating a new template is quite similar to editing an existing one. Instead of clicking on an existing template name, click the Create a new template link just below the tabs. (You can create any type except for System templates.) This will bring up the New Template Screen for that type.



