Sign in

How to make a quick links weblog in Movable Type

Be aware that, as Phil Greenspun writes, "[T]he only people who are attracted to work as [mainstream computer book] authors are the clueless and unemployed." This is just what I did to make my quick links weblog. Maybe someone will find it useful.

  1. When designing your main weblog, make ample use of template modules. (Optional.)
  2. Install some plugins:
  3. Make your new weblog. I put its files in a subdirectory of my weblog called quick. Set these preferences as follows:
    • Convert Line Breaks on by default: unchecked
    • Number of words in excerpt: 0
    • Preferred Archive Type: Monthly
    • Notify the following sites when I update my blog: depends on your choice; I have it off, but I get updates from blo.gs whenever Anil Dash's quick links update. Maybe that's why I have mine off.
    • Allow Pings on by default? unchecked
    • Allow Comments on by default? unchecked
  4. Under Archiving configuration, disable all archives except Monthly. Set its template to Date-based archive. I also set its Archive file template, the filename pattern, to something I prefer, like <$MTArchiveDate format="%Y_%B.html"$> (for example, 2002_January.html).
  5. In Manage Templates, delete all index templates except Archive index (and, if you like, an RSS feed of your choice). Set Archive index's output file to index.html. Delete all archive-related templates except Date-based archive. That's three templates, for my quick links blog:
    • Archive index at index.html
    • RSS 0.91 feed at index.xml
    • Date-based archive
  6. Edit your Archive index and Date-based archive templates to better match your main weblog's pages. If you did step #1, you can use <MTOtherBlog blog_name="yourWeblog"><$MTInclude name="module"$></MTOtherBlog> to speed the process, and keep your design in one place. Note that MTBlogName etc in any modules included this way will still be your main weblog's--but these quick links pages should be pretty no-frills anyway. Feel free to do what you like to make your templates how you want them, of course.
  7. Change the contents of your Date-based archive's MTEntries to something like:

    <MTEntries> <MTDateHeader> <h2 class="date"><$MTEntryDate format="%x"$></h2> <ul> </MTDateHeader> <li><a href="<$MTEntryBody encode_html="1"$>"<MTIfNotEmpty var="EntryExcerpt"> title="<$MTEntryExcerpt escape_html="1" escape_htmlattr="1"$>"</MTIfNotEmpty>><$MTEntryTitle$></a></li> <MTDateFooter></ul></MTDateFooter> </MTEntries>

  8. In your main weblog's index page, add something like:

    <MTOtherBlog blog_name="your quick links blog"><MTEntries lastn="4"> <a href="<$MTEntryBody escape_html="1"$>"<MTIfNotEmpty var="EntryExcerpt"> title="<$MTEntryExcerpt escape_html="1" escape_htmlattr="1"$>"</MTIfNotEmpty>><$MTEntryTitle$></a> </MTEntries></MTOtherBlog>

  9. When you post to your quick links blog, put the text to be linked in the entry title, the link (just the URL) in the entry body, and any link title text you want for the excerpt. Feel free to change your mind and templates if you'd rather put different parts in different entry fields.
  10. Install the pingToRebuild.cgi. This is optional, but will rebuild your main site's indexes when you post new quick links.
    1. Install SOAP Lite, if your host doesn't provide it. (Or switch to Cornerhost.) If you find you can't do this, which is entirely possible as SOAP Lite looks a bit complicated, I'm afraid you can't use this pingToRebuild.cgi. Sorry.
    2. Save this file to disk.
    3. Change the $fromBlogID and $toBlogID variables at the top as appropriate for your weblog. "From" is your quick links weblog and "to" is your main one.
    4. Upload the CGI to your Movable Type directory (where your mt.cgi is) as pingToRebuild.cgi. Set its permissions as necessary to run, probably by chmoding it 755.
    5. In your sidebar weblog's preferences, add the URL to the CGI (for me that's http://markpasc.org/mtx/pingToRebuild.cgi) to the Other sites to ping box under the (unchecked) checkboxes to ping weblogs.com and blo.gs.
  11. Save to a file named escapeHtmlattr.pl this code:

    use MT::Template::Context;
    MT::Template::Context->add_global_filter (escape_htmlattr => sub { my $s = shift; $s =~ s{"}{\\"}g; $s; });

    and upload it to your plugins directory. This will escape double-quotes in your entry excerpt/link titles. If you don't want to do this, be sure to remove the escape_htmlattr="1"s from the template examples above.

Problem: when you post a new item, the main weblog's index page isn't republished to reflect the change. I keep meaning to make a CGI that you can configure the quick links blog to ping, that would rebuild the main weblog's indices, but for now I'm fine with it only updating when I post to the main weblog too. Also, I think maybe I could use a ul on the front page, too, and factor the quick links entry code into a module of its own. Hmm.

Some similar directions you might like:

  • Matt of hitormiss.org shows how to integrate quicklinks with your regular entries.
  • Thomas Roessler 7:16 AM 8 Sep 2003

    A small twist of this is not to use MTOtherBlog, but the other blog's RSS feed, and mt-rssfeed. That's how I'm doing it. (pingToRebuild.pl is quite useful, though!)