‘Blogging tools’ Archive

8 Aprili 2003

What’s a Movable Type template?

There’s been so much “gee, would somebody please?” surrounding Liz Lawley’s suggestion of a MT-for-newbies tutorial that I thought I’d take a few whacks at parts of one. (Remember, all y’all, CavLec is public domain, so steal compendiously.)

Installation headaches I don’t know enough Perl or web-server administration to guide people through, but I do grok markup, so that’s where I’ll start.

You can look at and change your Movable Type templates by clicking on the TEMPLATES button in your blog’s left-hand Movable Type menu. Movable Type then gives you a list of the templates used for your blog.

No left-hand menu? You are probably at the main menu. Click on “Manage blog” in the box with your blog’s name. (If you aren’t at the main menu but can get there, do so, and then follow the advice preceding.)

No such button in your left-hand menu? Did someone else set up your blog? If so, ask that person to give you template-editing privileges.

Newbie hint number one: If the template title contains an acronym you don’t understand, pretend the template doesn’t exist. Believe me, this will save you a world of confusion. Don’t mess with RSS (any flavor) until you’re pretty confident about what you’re doing. Movable Type’s default setup will do you just fine in the meantime.

Your “Main index” template creates the front page of your blog. The “Master archive index” template (if you have one) lists all your archive pages; you can see CavLec’s archive index page here. This is probably the simplest of your templates, so it might be a good place to start learning about them. Each of your archive types will also have a template, though note that Movable Type uses the same template on all date-based (daily, weekly, monthly) templates your blog uses.

(Unless you fiddle around with Movable Type. You can get around this, but at this point you don’t want to bother.)

Click on the title of a template to see its contents and edit it.

Newbie hint number two: Ignore the “Output file,” “Rebuild this template when… and “Link this template to a file” options on the template-editing pages. Just leave them alone. You don’t need to mess with them. What you’re interested in is the actual contents of the template, which is in the “Template body” text-input area.

Next up: What you’ll see in a template.

18 Iulii 2002

Why to build your own template

During a spell of blogsurfing yesterday, I repeatedly ran across links to Paul Andrews’s blog. The other end of one such link spurred me to do what Jonathon Delacour calls “fossicking around” in the blog archives. Only then did I actually realize I had been repeatedly directed to this same blog.

Why didn’t I figure this out sooner? Because Paul uses a cookie-cutter Manila blog template. No visual cues to make the blog stand out from others using that same template.

I hadn’t realized before how much I associate blogs with their designs. Looking at my blogroll, though, I note how very few blogs using stock designs are there; of those that are, most are there because of personal contact between myself and the other blogger. Subliminally, unique design does seem to matter to me.

Certainly if I used a news aggregator (as most CavLec readers do, if my logs are any indication) it wouldn’t matter—or would it? What is the role of design in blog discovery as opposed to longtime reading, I wonder?

At any rate, this is a difference between blogging and letter-writing I hadn’t noticed before. Letter-writing offers rather less scope for design.

Yes, I am thinking about redesigning CavLec, however did you guess? I like what I’ve currently got; I am fond of the spacious feel. The unending gray is a bit chilly, though, and I find that I am immediately drawn to sites like Burningbird’s, epersonae’s, and the new design on visibledarkness, which all use a warmer palette.

So once I’ve taken a stab at a Blogger template for AKMA, who is still waiting for Movable Type, perhaps I’ll fiddle (offline) with warming up CavLec.

12 Iulii 2002

Blogclog

Know how to handle blogclog now. The method is interesting enough that I thought I’d share.

I did end up creating a new category called (what else?) “Blogclog.” Its posts propagate to the front page of Caveat Lector just as any other posts do. Most people in most browsers, however, will not see them.

How’d I swing that? CSS, of course, plus a little Movable Type jiggery-pokery. I used MT’s <MTEntryCategory> tag to put the category of each entry as part of the class attribute value for that entry. So the opening tag of a Gaming entry now reads <div class="blogbody gaming">. (It is perfectly acceptable to assign an element to two or more classes in this fashion.)

One thing to note: make sure to use dirify="1" in the <MTEntryCategory> tag. Otherwise, a multi-word category (such as my “Close to home”) won’t work right; the HTML parser will think you have added one class for each word of the category name, which is not what is wanted.

Then I nipped over to cavlec.css and added the rule div.blogclog { display: none }, which does pretty much what you would think it would do: blocks display of anything inside a div of class blogclog.

Finally, I went into my sidebar and added a list; the salient MT tag is <MTEntries category="blogclog" lastn="10">. (If I ever have more than ten entries in blogclog, I think the entire world will implode. I could be wrong about this, but I don’t care to test it.)

This is not an ideal solution. One problem is pinging all over the place just to add a blogclog entry, which most people will not find edifying. (If I get really daring, I will try to hack MT to prevent this, but I would guess that such a hack is beyond my nonexistent Perl.) Another is that if a blogclog entry is the only entry on a particular date, the main CavLec page will show an orphaned date header. Non-CSS-grokking browsers will display blogclog entries anyway, as will my RSS feed (though that I think I can fix).

Still, this is a vastly better kludge than the template module was.

9 Iulii 2002

Template modules

Did you ever notice how easy it is to use the same piece of markup in more than one blog template? Don’t you just hate it when you have to make the same change to, say, your blogroll in your archive templates as well as your main page? (Said in best Andy Rooney voice.)

Fortunately, Movable Type has a solution to this problem. It’s simple to use once explained, but it can be a little difficult to find and use, so stick with me while I explain it. Those of you who don’t use MT can ask yourselves why not while skipping the rest of this post.

(I meant to post this yesterday, but Murphy’s Web Browser ate one post, and Murphy’s Web Server went flaky last night just as I logged on and tried to redo it.)

If you click on the “Templates” button on your MT buttonbar, you see a list of your current templates. What you probably won’t see (unless you have a super-high-resolution monitor) is the bit at the bottom that says “Template Modules.” This is, however, the bit we want.

Clicking on “Create new template module” brings up a template-editing screen like any other. Give your new module a name (one word is a good idea), and enter the markup in the module-body window. For example, you could put your blogroll sidebar in a template module and call it “Sidebar”. I have. I did so with AKMA’s, too.

You include a template module in your other templates by reference. Open up a template where you want to include such a module. In the spot where you want to include it, type <$MTInclude module="nameofmodule"$>. For our sidebar above, the code would be <$MTInclude module="Sidebar"$>. Really pretty simple.

Now every time you make a change to your blogroll, you make it in one place—the template module—and it propagates to every template the module is included on.

I know Greymatter has similar functionality, but I don’t know about Radio. Helpful little trick, though.