Leo's MovableType Tips

by Leo A. Notenboom

by Ask Leo!

Leverage Your RSS Feed

Chances are your RSS or Atom feed template has a section that includes likes like these:

<MTEntries lastn="15">
<item>
<title><$MTEntryTitle remove_html="1" encode_xml="1"$></title>
<description><$MTEntryBody encode_xml="1"$></description>
<link><$MTEntryPermalink encode_xml="1"$></link>
<pubDate><$MTEntryDate format_name="rfc822"$></pubDate>
</item>
</MTEntries>

If so, you're missing out on something very, very powerful.

Continue reading "Leverage Your RSS Feed" »

Use Meaningful Page Names

It's a fairly common search engine technique to use "meaningful" page names in your URL. "apples.html" is seen by the search engines as more likely to be about apples than, say, "000023.html". Similarly, pages that are at the root of your site may be considered more "important" than those in subdirectories.

My approach at Ask Leo! is to use the article title as the basis for the URL and to place it in the root. Fortunately, MovableType makes both of the steps easy.

Continue reading "Use Meaningful Page Names" »

Get creative with Templates

There's nothing that says MovableType templates can't be added to create other types of files.

The challenge I had was this: I want to be able to have a list of all my category archive pages on some of the other pages that are not built by MovableType.

The solution? Create an index template that contains that list - and only that list - and have it produce an include file that I can use anywhere I like.

Continue reading "Get creative with Templates" »

Get creative with HTML

Remember that the goal of the templates is simply to transform your content into your desired results - normally HTML pages for display.

When dealing with templates, it's easy to think that you have to do everything using MT's constructs and easier still to get stuck into the rut of using only the examples or variations of the default templates.

Continue reading "Get creative with HTML" »

Repurpose the Excerpt

I found myself wanting to add a "Summary" for each article on Ask Leo! The summary is written by hand for each article - partly for the search engines, and partly to help people decide whether the article is, in fact, what they're looking for.

One complicating factor is that with over 860 articles, I wasn't about to add summaries for most. So I wanted summaries to be visible only if a summary had, indeed been written.

As we all know, there is no "Summary" field in MovableType, instead there's something called an "Excerpt". Excerpt serves my purposes well, but only after a minor configuration change.

Continue reading "Repurpose the Excerpt" »

Dealing with a Wealth of Comments

One of the interesting things about writing a technical Q&A site that deals primarily with Microsoft Windows is that people have no shortage of questions - and opinions. Lots of questions and lots of opinions. When some article pages became slow to load due to there being literally hundreds of comments I needed a solution. What I found was a MovableType extension: MTPaginate.

Have a look at the article What are "LSASS", "LSASS.EXE" and "Sasser" and how do I know if I'm infected? What do I do if I am? - it's one of my most viewed articles. One of the most commented on also. As I type this there are almost 400 comments on the article. Displaying all 400 at once (the way that MovableType's default templates work) would make for a very unwieldy page.

Now my approach is this:

Continue reading "Dealing with a Wealth of Comments" »

MovableType Styles

The default set of templates that come with MovableType make extensive use of the stylesheet "styles-site.css". It's possible, by manipulating only the stylesheet, to achieve dramatically different looks for a site based on the default templates.

MT's default CSS is far from trivial, nor is it documented anywhere that I can find. It requires an investment of time to understand. My original "Tip" was to invest that time understanding the default CSS.

Continue reading "MovableType Styles" »

Get between your Entry Body and Extended Entry

When you create a new entry in MT, you're presented with the default entry form that contains areas for both an Entry Body and an Extended Entry. Most folks use them for either of two purposes:

  1. The entry body is the "tease" portion of the entry that goes on to the home page, while the extended entry is the rest of the entry that shows up only on the entry's individual archive page.
  2. The entry body is what shows up in the RSS feed. The extended entry is the rest of the entry that shows up only on the entry's individual archive page.

Continue reading "Get between your Entry Body and Extended Entry" »

Next and Previous - Within a Category

MT automatically gives you the next and previous items for your individual archives with <MTEntryNext> and <MTEntryPrevious> items. The problem is that's within the global list of all entries within your blog. What if you wanted to link to the next or previous item within a given category?

As an example, check out any of the entries on Forwarded Funnies. There, in the upper right, you'll see not only a previous and next for "All Entries", but a separate previous and next for entries of the same rating as the current. In other words a previous and next for all the "G-Rated" entries if the current item is itself G-rated.

Needless to say, ratings within Forwarded Funnies are simply separate MT categories.

My approach uses a combination of PHP code generated from a category archive template, and a server-side include, or "SSI", in the individual entry archive template.

Continue reading "Next and Previous - Within a Category" »

Dealing with Comment Spam

Comment spam is the bane of the modern weblog. In an effort to boost their own ranking in the search engines, nefarious webmasters create software tools or "bots" that go out, find weblogs, and post scores of comments which contain links back to their sites. Those links are then seen by the search engines, which use the general rule that "the more people link to you, the more important you must be". The goal of comment spam is that the spammers' websites about poker, Viagra and body part enlargement get better search engine ranking as a result.

As weblog owners, not only do we not want to help the spammers, but we also just don't want their off-topic posts included in our weblogs.

Continue reading "Dealing with Comment Spam" »

Use Server-Side Includes

Server side includes (or "SSI") are a way to include the contents of one file into another. For example when this line in a .html page is processed by a web server that supports SSI:

<!--#include "text.inc"-->

It is replaced with the contents of the file "text.inc".

Server side includes are perfect for text on your blog pages that do not require any MovableType directives or variables and that you might want to change without rebuilding.

Take a look at this example from the Ask Leo! home page from some time ago:

Continue reading "Use Server-Side Includes" »