Eating your own dogfood

In reworking my site over the last week or so, I have managed to come up with some fancy new features for the next version of MultiBlog, mostly involving offset handling in the MultiBlogEntries tag.

You can now specify to which blogs the offset value is applied. Normally, with offset, the MultiBlogEntries tag will simply skip that number of entries. Now, if offset_local_only is set in addition to an offset value, only entries in the local blog (i.e. the blog in which the template is building) will be skipped. If offset_all_blogs is set, all of the blogs included will have offset number of entries skipped. And finally, offset_blogs can be used to indicate which blogs should have their entries skipped.

For example, I initially decided to display the latest entry in full from my main blog, followed by Google ads and then the rest of the entry list built from my blog and my wife's blog.

<!-- Latest entry from my blog -->
<MTEntries lastn="1">
<!-- Display entry here... -->
</MTEntries>

<!-- Google ad code here... -->

<!-- Display the rest of the latest entries from my blog and my wife's blog, 
making sure to exclude the latest entry from my blog only -->
<MTMultiBlogEntries lastn="12" include_blogs="2,16" offset="1" offset_local_only="1">
<!-- Entry display stuff here... -->
</MTMultiBlogEntries>

Then, since I have decided to fork my blog into plugins and personal blogs, I thought I would display the latest entry in both of those along with the latest entry from my wife's blog, followed by the rest of the latest entries, making sure to exclude the entries displayed previously. (Also of note is the change in the MultiBlog tag that preserves the ordering of the blog_ids passed to it)

<!-- Latest entry from all the blogs -->
<MTMultiBlog include_blogs="24,2,16">
<!-- Get the latest entry for the current blog in the loop -->
<MTEntries lastn="1">
<!-- Display entry here... -->
</MTEntries>
</MTMultiBlog>

<!-- Google ad code here... -->

<!-- Display the rest of the latest entries from my blogs and my wife's blog, 
making sure to exclude the latest entry from each blog -->
<MTMultiBlogEntries lastn="12" include_blogs="2,16,24" offset="1" offset_all_blogs="1">
<!-- Entry display stuff here... -->
</MTMultiBlogEntries>

Then I remembered that my wife prefers that I do not post any of her entries in their entirety on my page, so I would need to remove her blog from the first portion and make sure that her blog is not offset in the second portion.

<!-- Latest entry from all my blogs -->
<MTMultiBlog include_blogs="24,2">
<!-- Get the latest entry for the current blog in the loop -->
<MTEntries lastn="1">
<!-- Display entry here... -->
</MTEntries>
</MTMultiBlog>

<!-- Google ad code here... -->

<!-- Display the rest of the latest entries from my blogs and my wife's blog, 
making sure to exclude the latest entry from each blog -->
<MTMultiBlogEntries lastn="12" include_blogs="2,16,24" offset="1" offset_blogs="2,24">
<!-- Entry display stuff here... -->
</MTMultiBlogEntries>

Leave a comment

About Me

I am a software developer for Six Apart living outside of Baltimore, MD. I have written a number of plugins for Movable Type, including the award winning MultiBlog, which has (as of MT 4) been integrated into the base application....
More...

Recent Entries

  • The Olympics Make Me Want To Complete Again

    Every time the Olympics come around (most the summer ones) I always start to delude myself into thinking I could complete once again in the...

  • Minimalist plugins are fun!

    Last night I whipped up one of the smallest plugins I’ve ever written. It is so small in fact that I was able to stuff...

  • Feedburner Widget on MT News

    Movable Type News A WordPress 2.5 Upgrade Guide: And of course there are lots of third-party plugins for the MT dashboard, to integrate statistics and...

  • AD&D Monster Stats for the Presidential Canditates

    Charles Stross (scifi author, D&D nerd, and former perl columnist) posted Politics as she is Played with 3d6: The recent death of Gary Gygax, who...

  • Feedburner Widget 0.3

    At this point, I am really tempted to drop the ‘Widget’ from the name of the plugin, since it is doing so much more...

Close