Using CCK's nodereference field for a kind of footnote

Date: Thu Jan 14 2010 Drupal »»»» Drupal CCK »»»» Drupal Tutorial »»»» Drupal Planet
In two prior blog posts (see the references section below) I've discussed using a website content type to create resources lists. In this post I want to discuss another use, for a kind of footnoting system. You can see it in action below.

The footnotes module is one way of creating footnotes. However my idea is a little different, in that the "footnote" can be a direct reference to another complete node on the site. It's always useful to cross reference between nodes on a site both to aid the reader in finding related content, and the beneficial SEO effects from better navigation on the website.

The implementation is to simply use the Node Reference module bundled with CCK. Then add Node Reference fields to the content types where you want to make references. For example I have node reference fields attached to the blog and book content types.

The configuration I chose is for an unlimited number of node references, and for the widget to be the autocomplete text box. Also in the content type configuration is the method for displaying the field. I chose for the teaser display to simply be a link to the referenced node, but for the full node display to have a teaser for the referenced node. Unfortunately the teaser display is a little large and perhaps I will change the full node display to have simple links instead of the teaser.

Using it this way, to make a reference to an existing node one simply types in part of the node title. The autocomplete mode pops up a list of candidates and you can select from that. Unfortunately it doesn't work too well if you don't quite remember the title or there are a lot of similar titles.

I see there are a lot of addon modules for nodereference that make purport to add value. I haven't yet tried them, that's for a future blog post.