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
Post a comment
andy king 1 May 2007Permalink
hi,
i tried this same code in my new blog (MT 3.2)
and got an error when rebuilding the category archive
page thus:
Can't call method “id” on an undefined value at lib/MT/Entry.pm line 215.
do you use mt 3.2 or 3.3?