Skip navigation

Blog Magellan: Relationships

A couple of days ago I stated that I hadn’t yet begun looking for a navigation link plugin for WordPress yet, because I imagined that I could write one just as quickly myself rather than sift through a zillion plugins that all do the same thing in addition to suffering from bad cases of optionitis.

But I didn’t exactly start to write a plugin after I penned that. Nor did I start to look for one.

Until today. Writing one that is.

Features

  • Adds a “Start” relational resource link pointing to the front page.
  • Adds “Previous”/“Next”, “First”/“Last” relational resource links in the head, for quick navigation of posts or archives.
  • Adds an “Author” relational resource link pointing to the archive for the author when single posts are shown.
  • If the Creative Commons Configurator plugin is active a relational copyright resource link pointing to the license deed will be added.

Compatibility

This plugin has not yet been tested with WordPress 2.1 for compatibility. However, it has been audited following the notes from the WordPress developers and it should be compatible. As reported in the comments below, the plugin is not yet compatible with WordPress 2.1. Stay tuned for an update.

Download

The latest version (version 1.3) of the plugin can be downloaded as dahnielson_rellink_v13.zip.

Installation

  1. Download the dahnielson_rellink_v13.zip archive.
  2. Unpack the zip archive into your WordPress plugins directory.
  3. Activate the plugin in the WordPress administrator panel.
  4. Important: You have to specify a language by setting the WPLANG constant in the wp-config.php file, even if you use English as default.

Usage

When activated, the plugin add a number of relational resource links to the (X)HTML head. Browsers that recognise and support such links will use them to enhance the users experience of your site by providing additional in-browser navigation.

If the visitor are using Opera, and by enabling the “Navigation Toolbar”, an additional navigation bar with the supported links will be shown at the top of the browser making browsing of a site easier.

The links also provide accessibility enhancement for non-traditional browsers.

Example

This site is currently running the latest version. Take a look at the head in the source or if your browser implement it, turn on the “navigation bar” and try to navigate the site. Handy, eh?

ChangeLog

  • 1.0: Initial release.
  • 1.1: Minor fix
  • 1.2: Added permalink as rel-bookmark for single posts, and rel-up for navigation from daily to monthly to yearly archives to frontpage.
  • 1.3: The “I can’t believe I didn’t think of that in the previous one” release. Added rel-up to single posts.

9 comments

  1. Posted September 20, 2006 at 14:38 | Permalink

    I like the looks of it, but unfortunately it failed to load in my WordPress installation (WP 2.0.4). I get this error:

    Fatal error: Class 'CachedFileReader' not found in /var/www/dltj.org/htdocs/wp-includes/wp-l10n.php on line 67

    just after activating the plugin and on every subsequent page access. Any thoughts?

  2. Posted September 20, 2006 at 16:03 | Permalink

    That’s weird. Looks like your WordPress installation doesn’t include the CachedFileReader class found in wp-includes/streams.php. If the file exists, maybe it has the wrong file permissions set.

    The error occur when the plugin try to load the MO file containing translated strings. As a temporary solution, comment out line 28 in dahnielson_rellink.php. But I strongly recommend fixing the streams.php file for obvious reasons.

  3. Posted September 21, 2006 at 0:19 | Permalink

    I found the reason, by pure accident!

    Apparently, you have to set the WPLANG constant , even if the blog use default English, since the plugin use gettext. Add the following to your wp-config.php:

    define('WPLANG', 'en_US');

    I think this behavior is a bug in WordPress. If no language is specified it shouldn’t try to load any translation at all. But it do no harm to specify a language: if no translation exist for a string, it will use the original untranslated string as fallback.

  4. Posted September 21, 2006 at 1:43 | Permalink

    Great instincts! That did the trick. In actuality, my wp-config.php file had this line already:

    define('WPLANG', '');

    I added the “en_US” locale and your plugins are working now. Thanks for the reply.

  5. Posted November 21, 2006 at 15:41 | Permalink

    Hi, Your plugin worked fine for me, except that it works only on default template.
    The one I use, instead, doesn’t show the relational links (in particular the previous and the next ones).
    My site is italian, and I correctly configured the WPLANG in wp_config.php.
    No error … just, it works only on default.

    Have you any ideas ?
    you can take a look at the site(don’t bother the language), if you want.
    Thank you
    Regards
    Ehol

  6. oscar
    Posted January 23, 2007 at 16:04 | Permalink

    no longer works with wp 2.1… SQL query errors

  7. Posted January 23, 2007 at 16:15 | Permalink

    Thanks for pointing it out!

    I will update the plugin once I’ve upgraded WP myself (probably tomorrow).

  8. Posted January 28, 2007 at 20:52 | Permalink

    I’ve upgraded WP now and see the SQL error. The quick fix for the moment is to comment out the else statement in the function dahnielson_get_max_page($max_page) function. That way the plugin will almost work, meaning it provide correct links on post pages but not on the front page and archive pages. But don’t worry, I’ll figure out how to fix it properly.

  9. Posted February 16, 2007 at 16:43 | Permalink

    I am glad I found this page.. Thanks for posting the solution to “/wp-includes/wp-l10n.php Fatal error: Class ‘CachedFileReader’ not found in” problem.
    Cheers.

One Trackback/Pingback

  1. […] Visit […]

Post a comment

Your email is never published nor shared. Required fields are marked *
*
*
Creeper