Another idea

Another possible redesign

Work continues on reworking the design of this place. I think I’ve finally come up with something that I like, too — miracles never cease!

This time, I took some time to bounce around some of the sites that have caught my eye the most. Generally, they tend to be the exact opposite of what I’ve had here for a long time. Where I’ve had some sort of compulsion to present everything possible at once, all on the front page, I’m far more drawn to very sparse, open, clean designs. Yet, for absolutely no reason that I can come up with, I’d never made an attempt at that style.

So, this is where I think I’m heading at the moment. The navigation bar at the top will take care of all the extraneous crap. ‘About’ will lead to my about page, which will absorb things like my music and reading lists. ‘Past’ takes care of my archives. ‘Comments’ will catch the last n comments made (I’m waffling on this one, actually — it seems a little silly to have a page just for that, but it’s also really nice to have a quick reference of when someone’s said hello). ‘Elsewhere’ will handle both the blogroll and the Destinations feed (just how, I’m not sure yet, but that will come). And lastly, ‘Feeds’ will hold my RSS feeds (which I plan on expanding to include an excerpts feed, a full post feed, and a comment feed).

At least, that’s the basic concept to start with. As always, questions, comments and words of wisdom are greatly appreciated!

Update: A quick list of inspirations, code examples, and other ideas as I work on this. Links may be added here as I go.

Just an idea

Possible design tweak

I’m tinkering with ideas for the design here — kind of fun to do, but it’s definitely not one of my strong points (something that’s driven home when I keep seeing people come up with designs like this). Part of what I’m working with is something to seperate out the sidebars a bit. As it is now, I feel like the three columns blend together a bit too much, there’s no real visual distinction. I don’t want to go back to the boxy-borders look I used to have to separate things out — while it’s extremely simple to do by adding borders in CSS, it’s not very visually interesting.

So this is one possible idea I was dinking with tonight. Not a major redesign, and it pulls the columns out on their own while still pulling the eye into the center where the main content is with the lighter color. I’m just not entirely sure I really like it. Too grey, maybe? Hrmpf.

Someday I’m actually going to come up with a good, clean, attractive design. Until then (and that day may be a long, long time coming), I’ll keep poking, prodding, and stumbling around.

Oh, this'll be fun

I need to print, read, internalize, and (possibly hardest of all) understand the [Apache mod_rewrite documentation].

Why?

This is why. If I’m understanding what I’ve read so far, everything I want to do can be done purely through mod_rewrite. But, as of this writing, I have no idea how.

This could get interesting.

Destinations

Not much in the way of posting tonight. Instead, I concentrated on converting the ‘Destinations’ section of my sidebar so that all items now have comment and TrackBack ability, and there are archives for items that have scrolled off the page.

Doing this was fairly easy, if a little time consuming.

All I had to do was create a new weblog to hold all the links, instead of using a TypeList (since TypeLists don’t support archives, comments, or TrackBack). For the weblog itself, I just copied all my templates from Eclecticism so that the visual design matches this one, and then tweaked them a bit so that they linked directly back to Eclecticism’s main page rather than the new blog’s main page, as it’s intended to be a subset of this blog.

I then added a new Index Template that mimics the output of the TypeList. Since TypeLists are simply unordered lists, this was fairly easy to do — here’s my destinations.inc template:

<h2>Destinations</h2>
<ul>
 <mtentries lastn="10">
 <li><a href="<$MTEntryBody$>" title="<$MTEntryTitle$>"><$MTEntryTitle$></a>
  <mtentryIfExtended>
   <br />
   <$MTEntryMore$>
  </mtentryIfExtended>
  <mtentryIfAllowComments> | <a href="<$MTEntryPermalink$>#comments" title="Read comments for '<$MTEntryTitle$>'">c:<$MTEntryCommentCount$></a></mtentryIfAllowComments>
  <mtentryIfAllowPings> | <a href="<$MTEntryPermalink$>#trackback" title="See TrackBack pings for '<$MTEntryTitle$>'">tb:<$MTEntryTrackbackCount$></a></mtentryIfAllowPings>
 </li>
 </mtentries>
 <li><a href="http://djwudi.typepad.com/destinations/archives.html" title="Destinations archives">Archives&hellip;</a> | <a href="http://djwudi.typepad.com/destinations/index.rdf" title="Subscribe to Destinations">RSS Feed</a></li>
</ul>

Then I altered the code in the sidebar1.inc template for Eclecticism so that rather than inserting the Destinations TypeList, it inserted the destinations.inc file I had just created.

After that, it was just a matter of copying all the old TypeList entries into posts in the new Destinations weblog. Each post gets a normal title, the URL of the link goes in the main post body, and any descriptive text goes in the extended entry — very similar to the TypeList method of entry, just in a standard post form.

End result, the same basic functionality of the TypeList I was using before, only now with comments, TrackBack, and archives. Not bad for an evening’s work.

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…

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.

Live Comment Previews

The ‘Live Comment Preview’ hack that I use on The Long Letter has now been implemented here on Eclecticism. If you know what I’m talking about, then we’re good to go. If you don’t know what I’m talking about, then click on the “Comments” link to any post, type something in the comment box, and look just below the comment box. It’s a nifty trick. ;)

I originally picked this up from ScriptyGoddess, with help from Phillip. Geeky tech details on my implementation here follow.

All this is is a nice little JavaScript addition to the page. I don’t believe that this will constitute a security risk, but I’m no expert, so use at your own risk. ;) Obviously, if you do want to use this on your site, you’ll need to have access to your templates.

In the header of the individual entry template, just after the already included JavaScript bits, I added the following code:

<script type="text/javascript">
 var newline = /n/g;
 function ReloadTextDiv() {
  var NewText = document.getElementById("text").value;
  NewText = NewText.replace(newline, "<br />");
  var DivElement = document.getElementById("TextDisplay");
  DivElement.innerHTML = NewText;
  }
</script>

Then, in the body of the template, just after the closing </div> tag following the preview and submit buttons, but before the </form> tag, I added the following:

<br />
<h2>Live Comment Preview:</h2>
<span id="TextDisplay">Note: if you're comfortable with HTML, feel free to use it in your comments. If not, just type away. Single returns will be automatically converted into linebreaks (&lt;br /&gt;), double returns will be converted into paragraph breaks (&lt;p&gt;). This text will disappear as soon as you start typing.</span>

Lastly, in the textarea tag that defines where the comment text is entered in by a visitor, I added a onkeyup="ReloadTextDiv();" declaration. The full textarea tag should look as follows:

<textarea tabindex="4" id="text" name="text" rows="10" style="width: 80%;" onkeyup="ReloadTextDiv();">

What all this does is actually simple enough. As a visitor enters their comment into the comment box, each time they release a key the onkeyup function calls the ReloadTextDiv JavaScript snippet that I added. This function loads any text inside the comment box (identified by its ID of "text"), replaces any carriage returns with <br /> tags so that line breaks appear correctly, then writes the output into the element identified as "TextDisplay" — in this case, between the span tags I added after the submit and preview buttons.

If you find this useful, feel free to use it in your own pages. While I wouldn’t refuse credit, it really does belong to ScriptyGoddess and Phillip. Enjoy!

The skyline is back

One minor change to the site design here — I moved my shot of the Seattle skyline that I use over at The Long Letter to this weblog also. Even when that’s the only change, replacing that garish green with the black and white skyline gives a very different feel to the page. I like it. It’s a return to the cool blue/grey combination that I keep returning to.

Bright neon lime green just wasn’t “me”, anyway. ;)

Oh, by the way…

Reading Gabe’s musings on how to handle two blogs reminded me that I hadn’t ever answered my own question! At least, I hadn’t answered it over here — I did over on The Long Letter.

For the record, though, I’ve decided to put The Long Letter on hold for the duration of the TypePad beta, to give me the most possible opportunities to participate in the collective tire-kicking here. There are two projects that I’ve signed up for using The Long Letter’s address that I’ll post over there (26 Things and the Blogathon), but for now, everything else will show up here.