<mt:MultiBlog>

Type: block

Examples ΒΆ

<mt:MultiBlog>
  <!-- do something -->
</mt:MultiBlog>

Include the last 4 entries from the category "Releases" in blog with the ID of 1

<MTMultiBlog include_blogs="1">
    <MTEntries category="Releases" lastn="4">
         <$MTEntryTitle$>
    </MTEntries>
</MTMultiBlog>
This page was last updated on 2008-03-31, 12:28. [Edit]

7 Notes

It seems that this:

<mt:MultiBlog include_blogs="x">
    <mt:Entries category="foo">
        blurg
    </mt:Entries>
</mt:MultiBlog>

is quite a different context than this:

<mt:Entries blog_ids="x" category="foo">
    blurg
</mt:Entries>

which fails if "foo" is not a category in the CURRENT blog:

My brain says they should be the same, and I think the documentation needs to address this.

At the very least, this page should include some reference to the "include_blogs" attribute which is different from the "new normal" blog_ids

weird.. this multiblog doesnt work on my category Archive page. works fine on other template, except Category Archive.

any idea?

I confirm Faizal. It doesn't work on Category Archive Page! I am on MT Pro 4.261. Any idea?

I confirm Faizal. It doesn't work on Category Archive Page! I am on MT Pro 4.261. Any idea?

Category Archive pages establish a context, so it's the equivalent of writing:

<mt:multiblog blog_ids="all" category="currentcategory">

I'm still looking for a workaround :(

Unfortunately, this page isn't terribly helpful. It is cross-referenced from OtherBlog. That isn't very helpful either.

There is fairly detailed information. It just isn't here. It's over in the designer section (why?), here.

This is a summary:

Where to configure it

Configure Multiblog ("MB", aka OtherBlog or "OB") from either the Preferences > Plugins in your admin interface or in your template code directly.

Attributes of blog_ids, include_blogs and exclude_blogs

To pull or leave out content from other blogs:

  1. Use a comma-delimited list of blog ids;
  2. Use "all" for all blogs

Examples

    <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>


    <mt:MultiBlog include_blogs="all">
       <mt:Entries lastn="10">
          <p><mt:EntryTitle></p>
       </mt:Entries>
       <mt:Comments lastn="10">
          <p><mt:CommentBody></p>
       </mt:Entries>
    </mt:MultiBlog>


    <mt:MultiBlog blog_ids="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>

    <mt:MultiBlog exclude_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>

    <mt:MultiBlog blog_ids="all">
       <mt:Entries lastn="10">
          <p><mt:EntryTitle></p>
       </mt:Entries>
       <mt:Comments lastn="10">
          <p><mt:CommentBody></p>
       </mt:Entries>
    </mt:MultiBlog>

MB-Enabled Template Tags

These tags support the MB/OB syntax:

  • mt:entries
  • mt:comments
  • mt:categories
  • mt:pings
  • mt:assets
  • mt:tags
  • mt:tagsearchlink
  • mt:tagrank
  • mt:authors
  • mt:blogs
  • mt:blogcategorycount
  • mt:blogentrycount
  • mt:blogcommentcount
  • mt:blogpingcount

Important Note

As the previous notes show, MT:Entries 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:

    BlogId 1, categories: foo, bar
    BlogId 3, categories: foozball, barbarosa

then the second example will fail, because foozball isn't a category in BlogId1 where you're invoking MB/OB.

Real subtle, that. Like 10 hours of hair-pulling subtle.

And for that very reason, it also won't work in a category archive.

Configuring MultiBlog/OtherBlog: Rebuild Triggers

One of the most important aspects of this tag/feature is the rebuild trigger. Without the trigger, MB/OB can actually increase your workload.

Let's say you have three blogs, Main, Projects and Code. You want to aggregate your posts from Projects and Code and have them appear on the index page of Main.

Using the example code above, you actually do this. But this also means that when you publish a post in Projects or Code you must republish the index page of Main too.

That's daunting.

Fortunately, MB/OB has the answer built-in, right from its early development as a plug-in. You specify a rebuild trigger.

Go to the Preferences > Plugins section in your admin interface/control panel of your aggregator blog (Main, the one in which you want to pull the content from the other sub-blogs).

Click on settings; Click on Create Rebuild Triggers. Specify the event, and the corresponding action.

For the example above you'd set up two triggers:

  1. When Projects publishes an entry, rebuild indexes;
  2. When Code publishes an entry, rebuild indexes;

Leave a note

Have a question? Please use the MT Forums. Notes submitted on documentation should pertain to tips & hints regarding documentation. Your note may be removed once its contents have been integrated into the body of the page.