Random Line, Interesting MT Plugin

The Sun Pig has created a nice Movable Type plugin called Random Line. This is a powerful little plugin that lets you output random text (or images if you want) anywhere on your blog where you insert the tag.

See it at work on my sidebar under “Randomness.” Back when I first set up my blog, I had a “Random Quote” which was generated by JavaScript and it generated a new quote every time the page was refreshed. Which meant even if a single visitor refreshed the page or visited an archive entry page, he/she would see a different quote on each such visit to the page.

This plugin does not refresh on each visit to the page. It only changes the output when you REBUILD the template where the tag is contained, which in my case would be the Links module. Sometimes, I’ll go days without a complete rebuild. And folks who don’t stylistically change their blog templates every other day like I tend to do will do a total rebuild even less often.

Apparently, to get a more “dynamic” refresh, you’d need to do some kind of server side include or some other script. So for now, you guys are stuck with whatever happens to be there right now, until the next rebuild, anyway!

Correction: It turns out that the plugin will display new output each time your main blog template (index.html or index.php for most folks) is rebuilt. Ah, that’s a bit better!

That being said, the plugin itself is very easy to set up. Just create a text document with your favorite quotes (or scriptures or whatever else you want displayed). Put each on a line (don’t worry about wrap, just be sure you have a carrier return after each entry). You can point the plugin to your text file (which you should upload to your server) or make it an MT module.

Put the Random Line tag in your template and rebuild. Voila!

Leave a Comment