NAME
MT::TemplateMap - Movable Type archive-template association record
SYNOPSIS
use MT::TemplateMap;
my $map = MT::TemplateMap->new;
$map->blog_id($tmpl->blog_id);
$map->template_id($tmpl->id);
$map->archive_type('Monthly');
$map->file_template('<$MTArchiveDate format="%Y/%m/index.html"$>');
$map->is_preferred(1);
$map->save
or die $map->errstr;
DESCRIPTION
An MT::TemplateMap object represents a single association between an Archive Template and an archive type for a particular blog. For example, if you set up a template called Date-Based and assign to the Monthly archive type in your blog, such an association will be represented by one MT::TemplateMap object.
USAGE
As a subclass of MT::Object, MT::TemplateMap inherits all of the data-management and -storage methods from that class; thus you should look at the MT::Object documentation for details about creating a new object, loading an existing object, saving an object, etc.
DATA ACCESS METHODS
The MT::TemplateMap object holds the following pieces of data. These fields can be accessed and set using the standard data access methods described in the MT::Object documentation.
- id
- blog_id
- template_id
- archive_type
- file_template
- is_preferred
The numeric ID of the template map record.
The numeric ID of the blog with which this template map record is associated.
The numeric ID of the template.
The archive type; should be one of the following values: Individual, Daily, Weekly, Monthly, or Category.
The Archive File Template for this particular mapping; this defines the output files for the pages generated from the template for this archive type, using standard MT template tags.
A boolean flag specifying whether this particular template is preferred over any others defined for this archive type. This is used when generating links to archives of this archive type--the link will always link to the preferred archive type.
DATA LOOKUP
In addition to numeric ID lookup, you can look up or sort records by any combination of the following fields. See the load documentation in MT::Object for more information.
- blog_id
- template_id
- archive_type
- is_preferred
NOTES
- When you remove a MT::TemplateMap object using MT::TemplateMap::remove, if the $map object you are removing has the is_preferred flag set to true, and if there are any other MT::TemplateMap objects defined for this particular archive type and blog, the first of the other objects will be set as the preferred object. Its is_preferred flag will be set to true.
AUTHOR & COPYRIGHTS
Please see the MT manpage for author, copyright, and license information.
