Selectively Formatting an Entry
Published on February 23, 2007 at 7:53 AM EST
In the Tutorials category.
Why not try this treat in your restaurant?
With some creative use of Movable Type’s template tags it’s easy to create a differently-formatted page. For example, for short entries I just use the Entry Body field. For longer entries I use the Entry Body and Extended Entry, and the Entry Body serves as a lead-in to the full article.
How to do it is fine, but a visual is the key! Falsified examples follow:
With no extended entry:
With an extended entry:
What to Change
All you need to do is edit some templates. I changed the Individual Entry Archive a little bit, changing:
<div class="entry-body<MTEntryIfExtended> lead-in</MTEntryIfExtended>">
<MTEntryIfExtended> lead-in</MTEntryIfExtended> simply outputs the lead-in class text if the Extended Entry field gets used. So, hop over to the stylesheet where you can define the lead-in class by adding something like this:
font-weight: bold; }
The example above really just scratches the surface. There are plenty of other template tags you can play with (MTElse, MTIfCategory, and MTEntriesHeader, for example), as well as some plugins such as Compare.