September 09, 2003

How to make a moblog sidebar in MovableType

There is already one tutorial linked to at Mfop2 that documents a way to make a sidebar that displays moblog pictures in your main blog using PHP. I've found another way that is conceptually very similar, but uses a Movable Type plugin instead and may even be a bit simpler. I will assume that you've read the tutorial linked to above and keep my explanation to the bare bones.

What you need to do is:

1. Create a new blog (the moblog) in the same installation of MovableType as your main blog.

2. Create an Mfop2 account.

3. Download the MTOtherBlog plugin from David Raynes' site and install it in your MovableType plugins directory.

4. Insert the MTOtherBlog code wherever you feel like on your page. The moblog sidebar at gme.jp, for example, uses the following (with a few decorations that I have stripped out here):

<MTOtherBlog blog_id="5">
<a href="http://mo.gme.jp"><$MTBlogName$></a><br />
<MTEntries lastn="1">
<$MTEntryBody$>
</MTEntries>
</MTOtherBlog>

Literally all that you should need to do is set the other blog's ID and the number of entries you would like displayed; you can adjust what bits of the moblog entry (body, excerpts, date posted, author, etc.) display as you would for any other set of MT entries.

One thing to note is that even if you have posted a new entry to your moblog, the moblog image displayed in the sidebar in your main blog will not update until you rebuild the main blog.

Posted by gme at September 9, 2003 04:44 PM | TrackBack
Comments

You might want to put another plugin into the moblog, that will automatically rebuild the main blog everytime the moblog is rebuilt.

I don't know if it exists already, but it wouldn't be too hard to do should one be so inclined.

Posted by: Kevin at September 9, 2003 07:46 PM

Judging from a quick search it doesn't look like there is anything out there that will let you rebuild one blog whenever another is updated.

One thing I did find that might offer a partial solution would be the plugin at the link below, which allows you to rebuild a blog from the command line. In conjunction with cron it would then be possible to set up an automatic rebuild every x hours.

http://www.mplode.com/tima/files/mt-plugins/#mt-rebuild

Posted by: gme at September 10, 2003 01:04 PM

One thing I had overlooked is that any text in the Entry Body will appear under the image in the moblog bar. If you don't want it to (and I don't), there is a simple and obvious solution--put any text into the Extended Entry, by doing as follows:

1. Amend the email template in your phone to add the _MORE_ tag below the title/password/etc, like so:

@P=xxxxx@
@T=xxxxx@
_MORE_
[text goes here]

2. Amend your Movable Type moblog index template so that the extended text displays in line in the entry rather than being linked to. In other words, you stick the following after <$MTEntryBody$>:

<MTEntryIfExtended>
<$MTEntryMore$>
</MTEntryIfExtended>

All of this is probably blindingly obvious, but it didn't occur to me until after I done and gone and broke everything and I thought it might help others to avoid making the same mistakes.

Posted by: gme at September 18, 2003 05:31 PM

Have recently begun posting larger images from the phone and using Brad Choate's MTEmbedImage plugin to generate thumbnails in the index page of mo.gme.jp. This creates a problem in that EmbedImage doesn't appear to work with MTOtherBlog--it looks like the image path has to be within the same blog. The result was that as much of the full-size image as would fit in my links column was showing up; not ideal. I got around it with a somewhat less-than-ideal workaround suggested by this article (http://davextreme.typepad.com/davextreme/2003/08/templating_mfop.html) on writing Mfop2 templates. Long and short of it is, create a class in your stylesheet to resize the mo-bar images down to whatever size you need. Clumsy in that you have to load the full-size image just to see the thumbnail, but visually it works. Let's hope Kevin@Mfop can get his thumbnail creator working sometime soon!

Posted by: gme at October 6, 2003 12:59 PM

hi there, i'm late to this party but just wanted to say thanks for linking to my tutorial, and giving a folks an alternative (looking at mine now, it sure is ungainly and a bit intimidating). I did originally try the method you've outlined above, but the catch (or drawback as it were), which you have noted, was that the moblog wouldn't update until the main blog was refreshed, which sort of defeated the purpose for me, and I wasn't prepared to do the remaining plug-in/cron leg-work to work around that.

Posted by: Kurt at November 3, 2003 05:45 PM

I'm wondering if you have any hints on doing something much simpler?
I'd just like to be able to send photos to my Movable Type blog via MFOP2, in such a way that only a quarter-size thumbnail appears on the main blog page, and the full-sized image is available as a popup.
I have the MTEmbedImage plugin, but I don't know how to use it in this instance.
I'd be most grateful for any help you can give.
thanks

Posted by: Steve at January 20, 2004 04:14 PM
Post a comment









Remember personal info?