« Warning: TypePad now case sensitive for login names | Main | »

Advanced Templates in TypePad & a nice new conditional from Movable Type 2006

Not sure when it happened, but I noticed the other day that my clever hack for conditional behavior with regard to display was no longer working in my individual entry archives.

You have probably noticed I have two types of posts, ones like this, and quick little links or quotations which appear in a more compact form indented & with a border. I style these automatically.

In TypePad and Movable Type each entry has a main Body field and an Extended field. This allows you to do the "Read more..." approach and keep a big long essay off your front page. I personally don't mind having a big long essay up there - I trust your ability to scroll, dear reader - so I never used the Extended field for its intended purpose. Instead, I put my compact entries in that field, with nothing in the Body field.

This allowed me to use a conditional tag in TypePad advanced templates (which is the same in Movable Type), <MTEntryIfExtended> and <MTElse>.

I've just learned about a new tag (added in Movable Type 3.2, I think) and not yet reflected in the TypePad knowledge base, <MTIfNonEmpty>. It requires an attribute to identify the field to be examined, for example:
<MTIfNonEmpty tag="MTEntryMore">
This adds a huge amount of flexibility and I suspect it was greeted with much rejoicing in the Movable Type forums.

I've switched over my <MTEntryIfExtended> tags to use this approach instead and this resolved the problem I was having where the archive pages were not reacting conditionally. I rather suspect they are about to deprecate the older tag in favor of this new improved approach.

As ever, drop me a note if you notice something weird and I'll eventually find time to fix it.

Posted on May 27, 2006 at 11:51 AM | Permalink

Comments

« Warning: TypePad now case sensitive for login names | Main | »

Blog (noun) A weblog or similar brief journal usually containing links and commentary thereon. Term coined by Peter Merholz.
Visit Typepad or Blogger to start your own. (I began with hand coding, then switched to Blogger when it first became available, then to Movable Type when I wanted more control over my weblog and to have it hosted at a place of my choosing (Hurricane Electric). Now I use Typepad, built by the same folks who made Movable Type and I love it).

You may write to Dinah @ this domain.

Except where otherwise noted all content is copyright 1965-2012 Dinah Sanders. Please do not repost my writing or other creations elsewhere. Instead, copy a tiny bit and link to the rest. Thanks! Images are copyright of their original creators. MetaGrrrl logo and photos by Dinah are copyright 1965-2012 Dinah Sanders. Inkspot Books and the Inkspot logo have been Service Marks of Dinah Sanders since 1993.