Anne van Kesteren: Weblog 4.2

Weblog on W3C, WHATWG, HTML, CSS, DOM, XML, HTTP and more.

Added support for the LINK element

In my WordPress weblog I had support for the LINK element, but I hadn’t ported it over to my own yet. I published the PHP functions I used and I think it should be trivial to change them for your own weblog system. (You can remove the \n formatting if you want, I like my source like this.)

It is a shame browsers don’t have the navigation toolbar there by default. In Opera 8 you can reach it by ‘View » Toolbars » Navigation bar’ and for Firefox you need to install an extension called Link Toolbar (there are probably more). My Mozilla Suite is nonfunctional but there you needed to follow similar steps as in Opera and for Internet Explorer you need to download a plugin. Seriously, this should be one of the easiest parts to implement from HTML4:

This element defines a link. Unlike A, it may only appear in the HEAD section of a document, although it may appear any number of times. Although LINK has no content, it conveys relationship information that may be rendered by user agents in a variety of ways (e.g., a tool-bar with a drop-down menu of links).

It is optional, agreed. But it surely is useful to have.

As an example of the output you could look at my post about going to Copenhagen:

<link rel="top" href="/" title="Anne’s Weblog about Markup &amp; Style">
<link rel="up" href="/archives/2005/04/" title="Archives April 2005">
<link rel="first" href="/archives/2003/07/first-item" title="First Item!">
<link rel="prev" href="/archives/2005/04/role-attribute" title="XHTML2: ROLE attribute">
<link rel="next" href="/archives/2005/05/changes" title="Changes">
<link rel="last" href="/archives/2005/05/link-element" title="Added support for the LINK element">

4th May 2005

Browse through posts: main.

Comments

  1. This is bad. Why not make them normal hyperlinks, so everyone can use them. You can add rel attributes to those too, it's even shorter!

    Permalink · 2005-05-04 12:22:39 · Sjoerd Visscher

  2. @Sjoerd: Bad? Not. May have a higher weighting for search engines. Opera also support this (need to show a toolbar).

    Permalink · 2005-05-04 12:36:36 · minghong

  3. Does Opera not show the bar by default? I'm sure I remember it doing so, because it used to annoy me so I'd switch it off.

    Permalink · 2005-05-04 12:47:17 · paul haine

  4. To minghong: I have no issue with creating prev and next etc. links, only with how they are created. I.e. not:

    <link rel="next" href="/archives/2005/05/changes" title="Changes">

    but:

    <a rel="next" href="/archives/2005/05/changes">Changes</a>

    To paul haine: Opera 8 doesn't, I had to turn it on. It's way too big, and it doesn't look for rel attributes on hyperlinks.

    Permalink · 2005-05-04 12:55:53 · Sjoerd Visscher

  5. Sjoerd, like this? (See the second meta paragraph.)

    Permalink · 2005-05-04 12:57:47 · Anne

  6. I couldn't figure it out either, as to why the Site Navigation Link Toolbar was dropped from Firefox as it's a form of accessibility aid - I assume at some stage it will come back.

    Permalink · 2005-05-04 13:01:02 · Robert Wellock

  7. Robert > well, while you're right on that issue (even though I found much more annoying dropping the CSS switcher from the main interface) there are extensions for that behaviour/content

    On a side note: Anne, how about using the S accesskey for the preview button? That way one could submit his post to previewing as if he was typing in an IM client.

    Permalink · 2005-05-04 13:20:21 · Masklinn

  8. My bad, didn't even see that you had mentionned the FF extension in your post Anne.

    Permalink · 2005-05-04 13:21:28 · Masklinn

  9. Too bad Opera doesn't show title attribute of the Next/Prev links, and the user have no idea where it leads. So I vote for normal link with rel attribute, as they are more informative to me.

    Permalink · 2005-05-04 13:39:08 · PragmaInline

  10. I've no idea if this is possible, but can you style these to display in the viewport?

    If so, would their @href make them act like anchors? Could be a fun experiment :)

    Permalink · 2005-05-04 13:41:09 · Robin

  11. Robin, click here for an example. Written in XHTML so you have to use some normal browser.

    Permalink · 2005-05-04 13:43:23 · Anne

  12. Nice, click here links on this site. What's the world coming to?!

    Cool 'new features' btw! :)

    Permalink · 2005-05-04 14:37:14 · Krijn Hoetmer

  13. We've had these in Movable Type for a few years, and the few user agents that support them only support them in the HEAD as Anne has described. Using them inline seems more elegant, but won't be rendered with nav buttons in most cases.

    Permalink · 2005-05-05 01:25:02 · Anil

  14. Actually, link elements can be displayed as hyperlinks (see Thomas Scholzes textbrowser CSS).

    Permalink · 2005-05-05 07:35:51 · Markus Wulftange

  15. "Link Toolbar" could not be installed because of an error in it's Install Manifest ("linktoolbar" is not a valid GUID). Please contact the author of this item about the problem.

    Right now I have mailed Stephen Clavering, let's see (I'm using the latest trunk version of Mozilla Firefox (1.0+)).

    Permalink · 2005-05-05 14:06:50 · Johannes Lichtenberger

Comments are closed

Sorry, comments are closed at this time.