Not a developer? Go to MovableType.com

Documentation

include_blogs

Use this modifier in loop tags to include specific blogs or all blogs in the current Movable Type installation. “blog_ids” works same as “include_blogs”.

  • blog_ids=”all | children | siblings | ID”
  • include_blogs=”all | children | siblings | ID”
<mt:Entries include_blogs="1,2,3">
    <a href="<$mt:EntryPermalink$>"><$mt:EntryTitle$></a>
</mt:Entries>

include_blogs and exclude_blogs

The include_blogs is not technically a “global modifier” as it does not apply to all tags, rather just specific loop tags:

In a system context, such as search results, these loop tags default to include all blogs.

You can use the include_blogs and exclude_blogs attributes together in Movable Type 5.1 and later.

<mt:Entries include_blogs="children" exclude_blogs="2,4">
    <a href="<$mt:EntryPermalink$>"><$mt:EntryTitle$></a>      
</mt:Entries>

Values

A string of comma-separated blog IDs selects specific blogs:

    <mt:Entries blog_ids="3,7,44">
        <!-- do something here -->
    </mt:Entries>

The string “all” selects all blogs:

    <mt:Entries blog_ids="all">
        <!-- do something here -->
    </mt:Entries>

MT5.1 By assigning “children” or “siblings “, you can aggregate and display blog entries from all blogs under the website.

<mt:Entries include_blogs="children">
</mt:Entries>

If it is used under the website context, you can also assign include_with_website modifier to include the website contents.

<mt:Pages include_blogs="children" include_with_website="1">
</mt:Pages>

Examples

List the 10 most recent entries from blogs with ids 1, 2, and 3:

<ul>
<mt:Entries include_blogs="1,2,3" lastn="10">
  <li>
    <a href="<$mt:EntryPermalink$>"><$mt:EntryTitle$></a>
    (<a href="<$mt:EntryBlogURL$>"><$mt:EntryBlogName$></a>)
  </li>
</mt:Entries>
</ul>

List the 10 most recent comments from all blogs. Limit comment body to 10 words and place an ellipsis if greater than 10 words.

<ul>
<mt:Comments include_blogs="all" lastn="10" sort_order="descend">
  <$mt:CommentBody count_words="1" setvar="word_count"$>
  <li>
    <a href="<$mt:CommentLink$>"><$mt:CommentBody words="10"$><mt:If name="word_count" gt="10">...</mt:If></a>
  </li>
</mt:Comments>
</ul>
Back

1 Comment

Violet on January 27, 2011, 9:45 a.m. Reply

This modifier does work for mt:Assets in MT4.3x as well.

There’s more information about it here: Designer’s Guide: MultiBlog Template Tags