Two Things About Website Usability#

Ok so I'm not a usability expert on adding all kinds of semantic tags to the html for people with reading problems and such. I've read about it, I've seen it in action, and I understand the point and the need, but these things go pretty far and deep. So for blogs (to name an obvious example) I actually expect the engines and their templates to take care of this for me. My previous engine (nucleus) was pretty good at this really. But there are two few things that I explicitly do pay attention to myself just because there's fairly easy to implement or because it just makes the world a better place. (Right. Like any of this really matters. Anyway.)

One of them has to do with the regular expression I talked about in my blog migration post. Thanks to all of you for playing along with your numerous comments by the way ;-) The point is, when I'm browsing I want to know if a link will take me someplace outside the current site and if it will open a new window. As a precaution, I wind up right-clicking and choosing "Open in New Window" far too much... So I pumped this simple expression into dasBlog to replace all occurences of href="?(?<expr>http[^"\s]+)"? with href="${expr}" class="external" target="_blank". What this does is just take all hyperlink references that point to a place starting with http and add the mentioned class and target attributes to them. Indicating that it's an external link is done with the CSS class "external", which renders an external link differently than an internal one (hover over the nucleus link and the link to my other post above and note the difference). Opening a link in a new window is done by using the _blank target as you may know. Now this works on two simple assumptions:

  • All links within my site should have relative url's (so they don't start with http). Of course I could just as easily extend the regular expression to ignore my own url but this is sort of a mental reminder to keep my site free of absolute urls (in case I decide to change my root url someday)...
  • Every link to an external site should open in a new window. Leaving my site is your choice, not mine, so I leave it up to you to close the window :-)

By the way, the HTML 4.01 specification defines a rel attribute on a hyperlink that indicates the relationship between the document and the link target. Unfortunately it doesn't define an "external" link type that would specify the link will take you to an external site. There's an article about "New-Window Links in a Standards-Compliant World" that talks some more about this and provides a javascript that implements the behaviour I'd like to see - but I'd really like the browser to take care of this plumbing (like rendering it differently and having options to always open it in a new window for example). However, most browsers, like IE, don't support the attribute yet :-(

So that one's automated, the other thing I really try to hold myself to, is having meaningful hyperlinks. I really hate the "click here" style link that I'm certain served its purpose well in the early 90's when pretty much nobody had a clue what to do with a webpage or a link, but since then I think the web has become less about typing and more about writing (at least I hope so). A link should not be breaking your prose, it's not supposed to surface to the sentence flow. It's a way of navigating from one place to another, so the link's text should indicate by itself where it's taking you. A less obvious but nevertheless non-discardable advantage these days (where "knowledge" and "searching" are key, listen to any WinFS talk to convince yourself): while spidering your site, search engines like google can add their search semantics (metadata) to the link you're providing using the link text. So you are adding semantic value to other people's sites - where otherwise, the only semantics come from the site's owner. Pretty powerful I'd say.

Anyway, I'm off in that zone again, snapping back out of it now... If you got this far, at least you'll know when clicking a link on my site will open a new window ;-)

Tuesday, February 21, 2006 6:46:42 AM (Romance Standard Time, UTC+01:00)
Question... how did you do this... Your comment is "So I pumped this simple expression into dasBlog to replace all occurences " where, when, how, etc....
Tuesday, February 21, 2006 7:28:55 PM (Romance Standard Time, UTC+01:00)
You just log in to dasBlog, go to the Content Filters section and add a filter (using the + sign) that replaces the following (at the left):

href="?(?http[^"\s]+)"?

with (at the right):

href="${expr}" class="external" target="_blank"
Tuesday, May 23, 2006 10:04:02 PM (Romance Standard Time, UTC+01:00)
Hi... It looks like left and right angle brackets are probably being interpreted as HTML in the post and part of the target expression stripped. I found I had to use:

href="?(?XexprXhttp[^"\s]+)"?

The X's should be replaced with opening and closing angle brackets to produce the correct syntax.
Comments are closed.
All content © 2012, Jelle Druyts
On this page

Recent Photos
www.flickr.com
This is a Flickr badge showing public photos from Jelle Druyts. Make your own badge here.
Advertising
Top Picks
Statistics
Total Posts: 350
This Year: 0
This Month: 0
This Week: 0
Comments: 530
Archives
Sitemap
Disclaimer
This is my personal website, not my boss', not my mother's, and certainly not the pope's. My personal opinions may be irrelevant, inaccurate, boring or even plain wrong, I'm sorry if that makes you feel uncomfortable. But then again, you don't have to read them, I just hope you'll find something interesting here now and then. I'll certainly do my best. But if you don't like it, go read the pope's blog. I'm sure it's fascinating.

Powered by:
newtelligence dasBlog 2.0.7226.0

Sign In