monkinetic weblog

Steve Ivy's Weblog - Since 1999 - XII Ed.

Text Resources and Post Formatting

I recently found a solution to a problem that had been bugging me for some time.

Conversant has this really cool email gateway – all posts to this site go out to anyone who is subscribed to the site and has the list feature turned on.

So, when I write a post like this one, the post goes out over email, and the <blockquote> tags are stripped. How do my subscribers know where the quote is?

To the rescue: Conversant's text resources. A resource is like a Manila/Radio shortcut: it's a defined piece of text that gets replaced with something else when the content gets rendered. Resources are most often used for links and images, but Conversant has a powerful resource type called a Text Resource.

A text resource can have anything in it – html, text, and Conversant template macros. So I essentially write my own no-arg macro called 'quote':

<!--#if condition="ioInterface=='email'"-->
----- quote -----
<!--#else--><blockquote><!--#endif-->

If the post is being rendered for email, it inserts the "——quote——" text, otherwise it renders the blockquote tag. A partner resource called 'endquote' inserts "———" or the closing blockquote tag.

Now, when excerpting text, I start the excerpt with |quote| and close it with |endquote|, and it gets rendered legibly both on the site and in the list email.

My name is Steve Ivy and I write about technology, the open web, social software, and general nerdity on monkinetic.com. You should follow me on Twitter or subscribe to this blog if you like what you're reading. I spend my days hacking Movable Type, python, Django, and various other efforts at Wallrazer. This is my personal site.