Welcome to MTTags.com. Hopefully, you'll discover that this a really easy place to find information about Movable Type Template Tags. If you think we could be doing something better, please let us know! If this is your first time here, be sure to stop by the information desk, because we've got a growing todo list that might already include what you were about to suggest.
A container tag representing a list of categories in a weblog. This tag produces output for every category with no regard to their hierarchical structure.
show_empty
Setting this optional attribute to true (1) will include categories with no entries assigned. The default is false (0), where only categories with entry assignments are displayed.
A link to the archive page of the category.
Produces the dirified basename defined for the category in context.
default - A value to use in the event that no category is in context.separator - Valid values are "_" and "-". Specifying an underscore will convert any dashes to underscores. Specifying a dash will convert any underscores to dashes.The number of published entries for the category.
The description for the category.
The numeric system ID of the category.
A conditional tag that displays its contents if pings are enabled for the category in context.
The label of the category in context.
A container tag which creates a category context of the next category relative to the current entry category or archived category.
Optional attribute:
show_empty - Specifies whether categories with no entries assigned should be countedExample code:
<MTCategoryNext>
Next Category: <a href="<MTArchiveLink archive_type="Category">"><MTCategoryLabel></a>
</MTCategoryNext>
A container tag which creates a category context of the previous category relative to the current entry category or archived category.
Optional attribute:
show_empty - Specifies whether categories with no entries assigned should be countedExample code:
<MTCategoryPrevious>
Previous Category: <a href="<MTArchiveLink archive_type="Category">"><MTCategoryLabel></a>
</MTCategoryPrevious>
The number of published TrackBack pings for the category in context.
The URL that TrackBack pings can be sent for the category in context.
A specialized version of MTEntries that is aware of subcategories. The difference between the two tags is the behavior of the category attribute.
Attributes:
category - The value of this attribute is a category label. This will include any entries to that category and any of its subcategories.Since it is possible for two categories to have the same label, you can specify one particular category by including its ancestors, separated by slashes. For instance if you have a category "Flies" and within it a subcategory labeled "Fruit", you can ask for that category with category="Flies/Fruit". This would distinguish it from a category labeled "Fruit" within another called "Food Groups", for example, which could be identified using category="Food Groups/Fruit".
If any category in the ancestor chain has a slash in its label, the label must be quoted using square brackets: category="Beverages/[Coffee/Tea]" identifies a category labeled Coffee/Tea within a category labeled Beverages.
You can also use any of the other attributes available to MTEntries; and they should behave just as they do with the original tag.
A conditional tag that displays its contents if the current category does not have a parent category "above" it. Alternately the MTElse tag can be used in the MTHasParentCategory tagset.
A conditional tag that displays its contents if the current category does not have any subcategories. Alternately the MTElse tag can be used in the MTHasSubCategories tagset.
A conditional tag that displays its contents if the current category has a parent category "above" it.
A conditional tag that displays its contents if the current category has one or more subcategories.
A conditional block which tests attributes of the category currently in context and outputs its contents on a match.
This tag can be used anywhere where there is a category context:
name - Name of category for conditional testlabel - Alias of name attribute abovetype - Tests for the assignment type for the category, accepting values of primary and secondary.NOTE: There is currently a known issue related to this in that the value of 'secondary' is not accepted by the type attribute.
Conditional output based on category:
<MTIfCategory label="important">
This is important
<MTElse>
Misc is not so important
</MTElse>
</MTIfCategory>
This can be used in conjuction with CSS rules to display things differentially. This adds a class attribute of featured to the entry title h2 tag if the category of the entry is "Featured":
<h2 <MTIfCategory name="Featured">class="featured"</MTIfCategory>>
<MTEntryTitle>
</h2>
Below is a full example testing for not only category assignment, but also the type of assignment.
<MTIfCategory label="misc" type="primary">
Misc is the primary category
<MTElse>
<MTIfCategory label="misc" type="secondary">
Misc is the secondary category
<MTElse>
Misc is neither a primary not secondary category
</MTElse>
</MTIfCategory>
</MTElse>
</MTIfCategory>
A conditional tag that displays its contents if the current category is an ancestor of a specified child category in the subcategory hierarchy.
Attributes:
child - Required. The category label of the child to match against.A conditional tag that displays its contents if the current category is a descendant of a specified parent category in the subcategory hierarchy.
Attributes:
parent - Required. The category label of the parent to match against.A container tag that lists all the ancestors of the current category.
Attributes:
glue - This optional attribute is a shortcut for connecting each category label with its value. Single and double quotes are not permitted in the string.exclude_current -This optional boolean attribute controls the inclusion of the current category in the list.What is the default value of `exclude_current`? true or false? i'm assuming this is a boolean value. the current docs don't say.
A container tag that creates a context to the current category's parent.
A specialized version of MTCategories that respects the hierarchical structure of categories.
Attributes:
include_current - An optional boolean attribute that controls the inclusion of the current category in the list.sort_method - An optional and advanced usage attribute. A fully qualified Perl method name to be used to sort the categories.sort_order - Specifies the sort order of the category labels. Recognized values are "ascend" and "descend." The default is "ascend." This attribute is ignored if sort_method has been set.top - If set to 1, displays only top level categories. Same as using MTTopLevelCategories.The contents of this container tag will be displayed when the first category listed by a MTSubCategories tagset is reached.
The contents of this container tag will be displayed when the last category listed by a MTSubCategories tagset is reached.
Recursively call the MTSubcategories or MTTopLevelCategories container with the subcategories of the category in context. This tag, when placed at the end of loop controlled by one of the tags above will cause them to recursively descend into any subcategories that exist during the loop.
Attributes:
Example:
The following code prints out a recursive list of categories/subcategories, linking those with entries assigned to their category archive pages.
<MTTopLevelCategories>
<MTSubCatIsFirst><ul></MTSubCatIsFirst>
<MTIfNonZero tag="MTCategoryCount">
<li><a href="<$MTCategoryArchiveLink$>"
title="<$MTCategoryDescription$>"><MTCategoryLabel></a>
<MTElse>
<li><MTCategoryLabel>
</MTElse>
</MTIfNonZero>
<MTSubCatsRecurse>
</li>
<MTSubCatIsLast></ul></MTSubCatIsLast>
</MTTopLevelCategories>
Or more simply:
<MTTopLevelCategories>
<MTCategoryLabel>
<MTSubCatsRecurse>
</MTTopLevelCategories>
A container listing the categories that do not have a parent and exist at "the top" of the category hierarchy. Same as using MTSubCategories top="1".
A container tag that creates a context to the top-level ancestor of the current category.