Easy Templating with Individual Entry Archives

If you're like me, you don't like to code in theory. You're constantly rebuilding your templates to be sure that everything looks the way you want it to. This is fine when you're working with an index template. You can simply rebuild that one template and view your changes. But making changes to your individual entry archive usually means a full site rebuild to see your changes, which can be a real problem if you've got alot of entries.

So here are two quick tips for experimenting with your IEA's:

The Single Entry Save

Hacking Movable Type describes this technique. Make the changes to your IEA template, then pick an old obscure entry and resave it. That entry alone will be rebuilt and you can view your changes. The only drawback to this approach is that if you're truly experimenting with your IEA code, you have to overwrite what's there and (hopefully) back up the working copy of the template code to your notepad. That's why I've taken to using the second approach.

An IEA as an Index Template

When playing with the code, I like the idea of building just one file in a "hidden" location (e.g. '_index.php') to avoid people having a "broken experience". When working on my archive page or my index, I'll usually copy the template code and create a new template and set it up to publish to my "hidden" location of choice. With this little tip, you can do the same thing with your individual entry archives.

Simply create a new index template and paste your your IEA template code into it. Set it to publish wherever you like (e.g. '_iea.php'). Then wrap the entire template in:

<MTEntries lastn="1">

...YOUR IEA TEMPLATE CODE...

</MTEntries>

You guessed it. We're putting the entire IEA template in the context of one entry, which is basically what your IEA is anyhow. When you're happy with your IEA, copy and paste everying except for the beginning and ending tags. Voila!

(And if you don't like the way your last entry looks, just use the offset="x" attribute to push it back to previous entries.)

  • posted on 11 September 2006
  • by Jesse


YourThoughts?



(Minutia)

  • Author:
    Jesse
  • Published:
    Sep 11, 2006
  • Chapters:

GetUpdated

ElseWhere

Find me on aim Find me on delicious Find me on digg Find me on linkedin Find me on pownce Find me on twitter Find me on youtube Find me on skype Find me on facebook Find me on livejournal Find me on msn Find me on vox Find me on technorati Find me on yahoo Find me on dopplr Find me on lastfm

ActionStream

  • Jesse said, "Stumbled across a tricky CSS knot: rounded corners on table rows (vertical fluid only) w/o adding unnecessary markup. Suggestions?" Jesse said, “Stumbled across a tricky CSS knot: rounded corners on table rows (vertical fluid only) w/o adding unnecessary markup. Suggestions?” 2009-07-04T21:43:59Z 2009-07-04T21:43:59Z
  • Jesse saved The Declaration of Independence as a favorite video Jesse saved The Declaration of Independence as a favorite video 2009-07-04T21:00:08Z 2009-07-04T21:00:08Z
  • Jesse said, "We hold these truths to be self-evident. http://tr.im/qT9K (via @nathansmith)" Jesse said, “We hold these truths to be self-evident. http://tr.im/qT9K (via @nathansmith)” 2009-07-04T20:36:56Z 2009-07-04T20:36:56Z
  • Jesse said, "It's funny how difficult Drudge's headlines are to read in Independence Day blue." Jesse said, “It’s funny how difficult Drudge’s headlines are to read in Independence Day blue.” 2009-07-04T17:09:35Z 2009-07-04T17:09:35Z
  • Jesse said, "@foolmother Hilton did the same thing to me as well." Jesse said, “@foolmother Hilton did the same thing to me as well.” 2009-07-04T13:40:20Z 2009-07-04T13:40:20Z