brokenclay.org/journal

Movable Type Conversion

I’ve done my first conversion of a non-blog website over to using Movable Type.

First I read up on it:

Results first:
Previous, non-MT version
New, MT site

What I did:

This is a fairly static website with a flat navigational structure, so I decided to make each page a single entry.

After installing Movable Type, I set both the website URL and the archives URL to the root directory. This way individual entry files aren’t tucked away in an archives directory.

In Configuration|Preferences, I set Preferred Archive Type to Individual, and Text Formatting to None, so that I could use html to format each entry body. I set the Allow Comments default to None.

In Configuration|Archiving, I turned off everything except Individual, and put “<$MTEntryTitle dirify=”1″ $>.html” in the Archive File Template box. This causes MT to create filenames for the entry that look like the entry title, rather than filenames like 0002.html. An entry titled “Flowers in Summer” will be stored in flowers_in_summer.html.

Under Templates, I deleted everything except Main Index and Individual Entry Archive.

Then I started putting in the content.

Since every page gets its own entry, the navigation links can be derived from <MTEntries>. I created a template module called “nav” to be used both in the Main Index and Individual Entry templates. It looks like this:

   <a href="index.html">Home</a><br /><br />
   <MTEntries sort_order="descend" lastn="15">
   <a href="<$MTEntryPermalink$>"><$MTEntryTitle$></a><br /><br />
   </MTEntries>

<MTEntries sort_order=”descend” lastn=”15″> gives me the last 15 entries in descending order; I chose 15 because there are currently 9 pages, and I used the editable date/time stamp to force the order of the links.

The Main Index template is almost identical to the original home page, except that it uses <$MTBlogName$> for the title and <$MTInclude module=”nav”$> to pull in the list of entries for navigation.

The Individual Entry Archive template looks like the Main Index template except that the title is now <$MTBlogName$>: <$MTEntryTitle$<, and the actual content is replaced with:

      <h1><$MTEntryTitle$></h1>
      <$MTEntryBody$>

      <a name="more"></a>
      <$MTEntryMore$>

Then I created the entries, one for each page in the old website. I gave them titles that look like I want the links to look. I had to do some content editing to make sure that links to internal pages were corrected if the filename changed.

I used the power-editing mode to force the entries to the order I wanted; I pretty much used the timestamp to number them (ie, the entry I wanted first, I timestamped 01:00:00, the second was 02:00:00, and so on).

Now I have a nice new version of the website. In order to change the index page, I have to actually change the template and rebuild. In order to change any other page, I just edit the entry. The whole thing took about three hours.

Nice features include:

  • the search form on each page
  • being able to timestamp the page using an MT template tag instead of javascript
  • potentially having the users edit the pages themselves (although they’re still going to need to know html, always a stumbling block)
  • using MT template modules for repetitive code instead of server side includes
  • having the navigation menu auto-generate itself on every page when I add a new page
  • and of course, no more FTPing
Katja

2 Comments

  1. Becky

    Ooooh, thanks for this. I’d always wondered how to set up that kind of archiving. I’d assume that to archive by year/month/title.html you’d do something similar using MTEntryDate…?

    Reply
  2. Katja

    Yes – look in the MT manual under Archive File Templates. Examples:
    <$MTArchiveDate format=”%Y/%m/index.html”$> gives you 2001/12/index.html

    Reply

Leave a Comment

Your email address will not be published.

CommentLuv badge