Slug: text-resources-and-post-formatting Date: 2003-04-30 Title: Text Resources and Post Formatting layout: post

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.