Our friend, the humble 'title' attribute

Earlier this evening, I got an e-mail from Pops asking me how I created the little tooltip-style comment text that appears when you hover over links in my posts. I ended up giving him what was probably far more information than he was expecting, but I also figured that it was information worth posting here, on the off chance it might help someone else out.

It’s actually a really easy trick, though not one built into TypePad. Simply add a title declaration to the link itself. For instance, if I wanted the text “Three martinis and a cloud of dust” to appear when someone hovered over a link to Pops’ site, I’d code it like this:

<a href="http://2hrlunch.typepad.com/" title="Three martinis and a cloud of dust">Two Hour Lunch</a>

The end result looks like this (hover over the link to see the title attribute in action):

Two Hour Lunch

That little title attribute comes in wonderfully handy, too, as it can be applied to just about any HTML tag there is.

For instance, good HTML coding includes alt text for all images, so that if someone has image loading turned off in their browser, or if the image fails to load for any other reason, there will be some descriptive text to tell them what gorgeous vistas they are missing. However, in most browsers the only time that text shows is if the image doesn’t load. Using the title attribute in addition to the alt attribute when adding images, we can create that same style of comment when someone hovers over the image. For example:

<img src="lalala.gif" width="360" height="252" alt="NOTICE: I'm not listening!" title="La la la la la la!" />

That way, when displayed in the browser, if the image didn’t load, the text ‘NOTICE: I’m not listening!’ would show instead. In addition, the text ‘La la la la la la!’ will appear if someone lets their cursor pass over the image. Not a necessary thing, but it can be fun for quick, pithy little comments. Here’s the example:

NOTICE: I'm not listening!

Another place I use title tags fairly regularly is when I make changes to a post after it’s first posted. HTML includes two tags (<ins> and <del>, for insert and delete, respectively) for marking up changes to text. When I go back in to edit a post after it first appears on my site, I use those tags with a title attribute to indicate when the change was made.

For example, suppose I posted the following:

Pops is a screaming loony, who shouldn’t be allowed within twenty yards of anyone who isn’t equipped with body armor and a machete.

Later, coming to my senses, I could change that like this:

Pops is a <del title="7/30/03 10pm: I think I was on drugs when I wrote this.">screaming loony, who shouldn't be allowed within twenty yards of anyone who isn't equipped with body armor and a machete</del> <ins title="Here's what I meant to say...">great guy, whose website has pointed me to some fascinating tidbits on a regular basis</ins>.

(I hope Pops doesn’t mind the sample text here.) ;)

On screen, after the update, the deleted text would display as struck through, and the inserted text would display underlined (standard editing notation), with the comments displaying on a cursor hover, like this:

Pops is a screaming loony, who shouldn’t be allowed within twenty yards of anyone who isn’t equipped with body armor and a machete great guy, whose website has pointed me to some fascinating tidbits on a regular basis.

So there ya go — more information on the humble little ‘title’ attribute than you probably ever wanted or needed to know. I hope it helps!

Update: (See? There’s a title attribute right there!) As of this writing, the title attribute is barely supported in Apple’s new web browser, Safari. Titles on links will appear in the status bar at the bottom of the window if the status bar is turned on, but that’s it. No other title text will be visible. I’m hoping that this is fixed in a later update to Safari, but for the moment, that’s what we have to work with.

Importing MT archives: month by month

I’m starting work on importing my archives from The Long Letter into Eclecticism.

What I’m dealing with is simply the fact that I have archives dating back to November of 2000. While Movable Type has an ‘export’ feature, it exports everything. With fewer posts, that might be less of an issue, but since I’m going to have to go through post-by-post to double-check URLs, add pictures, and so on, I wanted to see if I could figure out how to import one month’s worth of posts at a time, instead of the whole kit and kaboodle.

Here’s what I ended up with…

  1. Create a new Archive Template, and put the following code into the template:
     TITLE:
     AUTHOR:
     DATE:
     PRIMARY CATEGORY:
     CATEGORY:
     -----
     BODY:
    
     -----
     EXTENDED BODY:
    
     -----
     EXCERPT:
    
     -----
     COMMENT:
    
     AUTHOR:
    
     EMAIL:
    
     URL:
    
     IP:
    
     DATE:
    
     -----
     PING:
    
     TITLE:
    
     URL:
    
     IP:
    
     BLOG NAME:
    
     DATE:
    
     -----
     --------
    
  2. In MT, under the ‘Weblog Config’ button, go to the ‘Archiving’ section. Click the ‘Add new…’ button, set the Archive Type to ‘Monthly’, and the ‘Template’ to the name of the new template that you just created, then click ‘Add.’

  3. You should now have two options under the ‘Monthly’ archive type. Switch over to the new archive template that you just created, and put the following in the ‘Archive File Template’ box:

    export/.txt

  4. Click the ‘Rebuild Site’ option, choose the ‘Rebuild Monthly Archive Only’ option, and click the ‘Rebuild’ button.

    Once MT is done rebuilding, you should have a series of files inside an ‘export’ directory inside your site’s archives directory (in my case, that ended up being /longletter/archives/export/, your configuration may be slightly different). There will be one file for each month, named something like 2003-07.txt.

  5. In TypePad, under the ‘Manage’ tab for your weblog, choose the ‘Import/Export’ option. In box A, put in the URL for your first month’s export file (for me, this was http://www.djwudi.com/longletter/archives/export/2000-11.txt). Leave the ‘Encoding’ drop-down menu set to ‘Unicode’, and hit the ‘Import’ button.

  6. There is no step 6. You’re done!

So that’s it. Now that I can go month by month, I’ll import one month, go through each post to make sure all the links are correct, then move on to the next month. This will probably take a while, as I’ve got close to three years of posts to check, but I’m on my way!

And the word ‘PROJECT’ flashed before my eyes…

Custom MT skins?

Custom MT interface

So it appears that SocialDynamX, creators of FMRadio for Radio Userland (Disclaimer: I know nothing about either of these products) is working on creating a custom interface for MovableType.

First impression? Ugh, that’s horrid.

Now, I’m a little unclear from looking at their site as to whether that’s a replacment for the default MT interface that you see in your web browser (as is implied by the term “skin”), or whether it’s a seperate standalone program for posting to MT (such as Kung-Log, UserSpace or Zempt). If it’s a standalone program, then okay, it’s most likely Windows-based, and the horrid ugly interface makes sense. But if it’s a “skin” designed to replace the standard MT interface within the browser — why is it so verschluggene ugly?

I was going to go into more detail, but I’ve gotta head off to work, and I’m out of time. Judge for yourself, I guess. ;)

(via Scoble)

About 'Noises'

I wanted to take a moment to draw attention to the ‘Noises’ section of the sidebar to the left of this page. I’m tossing albums up there at more or less random intervals (often determined by what I’m listening to at any given point in the day). When I do, though, I’m highlighting three key tracks from the album and adding streaming audio ‘PLAY’ links to them, in addition to one for the full album.

The albums won’t stay up indefinitely, and the tracks aren’t downloadable (streaming only, sorry), but this should let anyone stopping by take a quick listen to whatever I’m recommending — and, of course, clicking through the picture lets you buy it from Amazon.

Enjoy!

My MovableType/TypePad History

On October 2, 2001, Ben and Mena Trott gave an interview regarding their newly announced weblogging program, MovableType.

On October 8, 2001, MovableType v1.00 was released to the public.

On December 21, 2001, I started using MovableType for my weblog. This would have been v1.31 at the time.

On April 23, 2003, TypePad was announced and the TypePad site went live with some teaser info on the new service.

On June 24, 2003, TypePad beta testing was announced. I, along with many other people, applied for a spot in the next round of testing.

On July 7, 2003, I was notified that I had a new toy to play with. ;)

The point to all this? No point at all, really. Just kind of cool knowing that I’ve been doing my small part to help the Trotts take over the world almost since the beginning. Not quite from the very beginning, but pretty durn close.

TrackBack spam? Grrrr…

Well, here’s a first (for me, at least) — I just got TrackBack spam. One of the posts on my other site — this one, to be precise — just got a TrackBack ping (which I’ve just deleted) with no information other than a URL pointing to, of all places, the Thessaloniki Port Authority (http://www.thpa.gr/ — I’m not giving them the Googlejuice of a live link).

Bad enough that they used TrackBack to spam me, but the Thessaloniki Port Authority? That’s just wierd. And on a computer-related humor post, too. Just bizarre.

TPBETA 1505

TPBETA 1505

My own little concept for marking my spot as a TypePad beta tester. A small badge, with ‘TPBETA’ on the left, and ‘1505’ on the right. 1505 is the ID number for my TP blog — obviously, the older the blog, the lower the ID number will be. Just another idea to toss into the mix of ideas running around right now. ;)

On the off chance anyone wants to duplicate this, I used the Kalsey Button Maker with the following settings:

  • Outer border: 666666
  • Inner border: ffffff
  • Bar position: 50 pixels from left
  • Left box:
    • Text: tpbeta
    • Background: 006699
    • Text color: ffffff
    • Text start: 5 pixels from left
  • Right box:
    • Text: 1505
    • Background: dddddd
    • Text color: 000000
    • Text start: 4 pixels from the bar

Update (prompted by Grumpy’s comment): You can find your blog ID# by logging into your TypePad admin page, going to your weblog editing screen, and checking the address bar of your browser. The end of the URL will look something like blog_id=1505 — there you go!

TPS Syndrome

Am I suffering from TPS: TypePad Snobbery? You know it, baby! ;)

Common symptoms discovered so far: