Phil Gyford’s website

Category Archives with MTMultiBlog

This is mainly for anyone Googling for how to get MTMultiBlog to display a list of entries in their Movable Type Category Archive pages. I spent a while Googling for an answer this week, finding only questions. So here’s what I’ve done.

Originally I tried this:

<MTMultiBlogEntries include_blogs="1,2,3">
    <div><a href="<$MTEntryPermalink$>"><$MTEntryTitle$></a></div>
</MTMultiBlogEntries>

I assumed that should have worked, because you’re just displaying entries in a Category context. But it seemed to display all entries, no matter which category they’re from. The only solution I could find was to force MTMultiBlogEntries to a specific category, which I did using the handy MTTagInvoke plugin:

<MTTagInvoke tag_name="MTMultiBlogEntries" include_blogs="1,2,3">
    <MTTagAttribute name="category"><$MTCategoryLabel$></MTTagAttribute>
    <MTTagContent>
        <div><a href="<$MTEntryPermalink$>"><$MTEntryTitle$></a></div>
    </MTTagContent>
</MTTagInvoke>

If you have a long list of entries in each category and want to display them in a series of shorter pages, you could use the MTPaginate plugin like this:

<MTPaginate>
    <MTPaginateContent max_sections="5" section_start_tag="div">
        <MTTagInvoke tag_name="MTMultiBlogEntries" include_blogs="1,2,3">
            <MTTagAttribute name="category"><$MTCategoryLabel$></MTTagAttribute>
            <MTTagContent>
                <div><a href="<$MTEntryPermalink$>"><$MTEntryTitle$></a></div>
                <$MTPaginateSectionBreak$>
            </MTTagContent>
        </MTTagInvoke>
    </MTPaginateContent>
    <MTPaginateIfMultiplePages>
        <p class="pages"><$MTPaginateNavigator style="links"$></p>
    </MTPaginateIfMultiplePages>
</MTPaginate>

That should split the list of entries up into pages of 5 entries per page.

Obviously, in all examples, replace “1,2,3” with your list of blog IDs to use. This was using Movable Type 3.2 and, I think, MTMultiBlog v1.99.4a.

Comments

Saturday 24 June 2006, 3:18pm

< PreviousIn all of WritingNext >

24 Jun 2006 in Links

On this day I was reading