Friday, 9 January, 2009 - 2:49pm (Sydney Australia)

Sections are now real pages

Today has been a busy day here at GreenAsh. As well as some other (smaller) changes, we've implemented a new module that allows us to create "real" pages for our various sections. This module was custom written by us, specifically for the purpose of introducing more functionality into this web site. So now, for the first time (because of the new module), you can comment on our sections, you can view printer-friendly versions of them, and you can do anything else that was previously possible only for real pages, such as posts.

The new module is called taxonomy_assoc. It was written in PHP, as a module for the Drupal CMS, which is the software that we use to power this site. The way Drupal works, is that every piece of content on your site is stored as something called a node. Everything in Drupal revolves around nodes: many modules (such as commenting and filtering) are written specifically to act on individual nodes; and most of the content on this site is stored in a number of nodes. For example, this news article is one node, as is every other news article on the site.

But up until now, the sections of our site have not themselves been nodes: they are just 'placeholders', if you will, in which real nodes are stored. The implication of this is that you cannot comment on the descriptions in our sections; you cannot view printer-friendly versions of our sections; and you cannot do anything else that is possible with a node.

Our new module lets us 'associate' a node with a section of our site. That node is then displayed as the section's description. You'll notice that underneath the description of a section, there are now all the familiar options, such as 'add new comment', etc. The posts section, for example, now has these options, because it is now more than just a section: it is a real node that is displayed as the section's description.

We'll be releasing the taxonomy_assoc module as free, open source code on drupal.org in the near future. In the meantime, we're going to continue testing it, looking for ways to improve and refine it, and overall making it of good enough quality to be of use to the wider web development community.

You may also have noticed that we've added a hit counter to the bottom of the front page. This counter is dynamically generated, based on the site's access logs, which are discarded after 4 weeks. Underneath the hit counter, there is also a link to the site's main XML feed. This feed has always been available, but a link to it has not been displayed anywhere on the site before (although many of you that use XML-aware web browsers, such as Mozilla Firefox, would have had access to it before now).

Also on the XML/RSS front, we've patched up our sections now, so that XML feeds are only available for those sections that actually have content inside them. Most of our top-level sections, such as posts, are just placeholders for sub-sections, and so before now they were offering our visitors empty feeds. Such sections have now had all XML syndication removed from them, since there is nothing in them that needs syndicating anyway.

Filed in: