Not a developer? Go to MovableType.com

Documentation

MultiBlog

MultiBlog is a feature in Movable Type that allows content to be easily aggregated from multiple websites or blogs within your Movable Type install to a single website or blog.

While this page title references the MultiBlog template tag, note that it’s many features are detailed here including attributes that can be used with other tags.

Configuration

It’s likely that you’ll use both the template tags and user interface to configure how MultiBlog functions on your site.

User Interface

MultiBlog is configured through the Movable Type user interface via the Settings area under the “Tools > Plugins.” MultiBlog can be configured at the System, Website, and Blog levels and settings are inherited. That is, System-level options will be inherited by all Websites and Blogs, and Website-level options will be inherited by Blogs within that Website, for example.

  • Content Privacy: a way to set default privacy for the selected Website and/or Blogs when not explicitly specifying blog IDs.

  • MultiBlog Target Default Arguments: Enables use of the MultiBlog tag without the include_blogs/exclude_blogs attributes. Comma-separated Blog IDs or “all” (for include_blogs only) are acceptable values.

  • Rebuild Triggers: Republish indexes when other blogs change; this is an effective way to keep the aggregating website/blog up-to-date. Note that this feature should be carefully configured — unnecessarily triggering republishing will surely increase server load substantially. Configure the aggregating blog to republish as little as necessary — that is, if Comments are not published on the aggregating blog there is no reason to republish when comments are received.

    Click on “Create Rebuild Triggers.” Select a blog, specify the event, and the corresponding action.

Template Tags

The sources can also be configured manually via your template code directly. A number of template tags support the blog_ids template tag attribute which is used for selecting the blogs across which to aggregate content. For example, the following template tag code sample will aggregate content across blogs with an ID of 1, 2 and 5:

<mt:Entries blog_ids="1,2,5">
   <p><mt:EntryTitle></p>
</mt:Entries>

The MultiBlog Template Tag

If you wish to set a context that includes multiple blogs that can span across multiple tags, one can use the <mt:Multiblog> template tag. This tag can encapsulate any number of tags that are “multiblog enabled” (see below) and will govern their respective scopes. For example, the following template tag code sample will output the last ten comments and entries for blogs with ids 1, 5 and 8.

<mt:MultiBlog include_blogs="1,5,8">
   <mt:Entries lastn="10">
      <p><mt:EntryTitle></p>
   </mt:Entries>
   <mt:Comments lastn="10">
      <p><mt:CommentBody></p>
   </mt:Entries>
</mt:MultiBlog>

Attributes

If none of these attributes are provided, then Movable Type will default to searching the current blog context only.

  • ignore_archive_context (New in MT 6.0.2) Usually when a block tag is used in an archive template, any archive filtering conditions that are already in place will be automatically applied (blog ID, category, list of loaded entries, etc.). If the ignore_archive_context modifier is set to 1, data will load without automatically activating preset archive filters.

MultiBlog Enabled Template Tags

The following tags support the use of the above attributes. For example:

<mt:Assets include_blogs="1,5,8">
    <p><mt:AssetTitle>: <mt:AssetURL></p>
</mt:Assets>

Context

Creating a MultiBlog context may not give you the results expected depending upon the combination of tags and attributes used, and the content available in a given blog.

As the previous notes show, the Entries template tag also supports the blog_ids attribute. But doing:

<mt:MultiBlog include_blogs="3">
    <mt:Entries category="foozball">
        some yada yada
    </mt:Entries>
</mt:MultiBlog>

is not the same thing as doing:

<mt:Entries blog_ids="3" category="foozball">
    some yada yada
</mt:Entries>

The second expects that even if the blog with id No 3 does have a category called “foozball,” that very same category must also exist in the current blog.

So if you have this:

  • Blog ID 1, categories: foo, bar
  • Blog ID 3, categories: foozball, barbarosa

then the second example will fail, because “foozball” isn’t a category in Blog ID 1 where MultiBlog is invoked.

Back

1 Comment

Ann Ray

Ann Ray on October 15, 2012, 9:43 a.m. Reply

Couldn’t get this to work until I changed it from name=”BlogID” to tag=”BlogID”. Great for my FeedBurner URLs:

<mt:If tag=”BlogID” eq=”8”><$mt:Var name=”feedburner” value=”Whatever”$> </mt:If$>

<link rel=”alternate” type=”application/rss+xml” title=”<$mt:BlogName encode_html=”1”> via FeedBurner” href=”http://feeds.feedburner.com/<$mt:Var name=”feedburner”$>” />