Movable Type Documentation

« MTDateHeader | Up | MTEntriesFooter »

Chapter Entry

MTEntries

A container tag which iterates over a list of published entries from a weblog. The default behavior is set according to the "Entries to Display" and "Entry Order" controls in the General Settings. These settings can be overridden with the use of these optional attributes.

Entry Filtering Attributes:

  • author - Filters the entries by the given author's username.
  • category - Filters the entries by the given category label. Multiple categories can be defined in the value of the attribute and can include boolean "AND" and "OR" logic. Boolean logic may not be mixed. For instance "Foo AND Bar OR Baz" is not permitted.
  • tag - Filters the entries by the given assigned tag or a boolean logic construct. See below for details.
  • days - Filters all posts less than N days old. N is a positive integer. days should be used separately from other attributes. If used with another attribute, days is ignored.
  • lastn - Display the last N posts of the weblog. N is a positive integer.
  • offset - Used in coordination with lastn, starts M entries from the start of the list. N is a positive integer.
  • recently_commented_on - Display the N most recently commented-on entries. Each entry will appear in the list only once. N is a positive integer.
  • blog_ids - This attribute allows you to aggregate entries from other blogs into your MTEntries listing. Blogs are specified by their blog IDs in a comma-delimited fashion. (e.g. <MTEntries blog_ids="1,12,19,37,112">). A value of all expands the context to all blogs in the installation. This feature is available only in Movable Type Enterprise.

Entry Sorting Attributes:

  • sort_by - Specifies the field to sort the list by. Recognized values are "title," "modified_on," "author_id," and "excerpt." The default is the authored on date.
  • sort_order - Specifies the sort order and overrides the General Settings. Recognized values are "ascend" and "descend."

When used as an attribute of MTEntries in the templates, the days, lastn, and sort_order attributes override their corresponding settings in the weblog's General settings menu.

Boolean logic for category and tag attributes Can do advanced boolean logic in category and tag attributes (AND, OR, NOT, parenthetical grouping). For example:

<MTEntries category="((Cats AND Dogs) OR General) NOT Private">

Combination of attributes

  • Can combine attributes (e.g. lastn="1" category="Important")
  • Order of attributes matters (i.e. trim_to="10" words="10" is different than words="10" trim_to="10")
  • Repeated attributes are processed (i.e. regexp="[regex1]" regexp="[regex2]")

Submit Feedback on This Article

Your comments on how we can improve this article are appreciated; but please do not use the feedback form to submit support requests or question. We will not respond to or publish such queries submitted through this form. If you have a technical question or problem, visit Movable Type Support.

Six Apart
Makers of weblog software and services for individuals, organizations and businesses.
This website is powered by Movable Type.