Custom Term Path
Some of our customers want to have the taxonomy terms linked to the search module instead of the taxonomy page. Especially in cases where the taxonomy pages aren’t themed this is very desirable.
The small module attached provides a new configuration field to the vocabulary add / edit pages where you can fill in a custom path. This path is used for the taxonomy links within the nodes.
Heading Normalizer
I thought of writing a module which can fix the heading usage (H1..H6 tags) in an input filter. The content you write (in a wysiwyg editor or using markdown for example) is generally starting with H1. Sometimes with another heading, but usually something wrong… I am (of course) not the first with this idea. It is already released, and it’s called Heading Normalizer. Surely something which all projects should use. And maybe even something which should be in core.
Caching path aliases
When troubleshooting performance on Drupal websites you may find out that Drupal executes tenths or hundreds of queries per request to get an alias by the internal path. This is done in the function drupal_lookup_path (which resides in includes/path.inc). The query is:
SELECT dst FROM url_alias WHERE src = 'node/3496' AND language IN('nl', '') ORDER BY language DESC
Although this is a fast query, it’s desired to cache those cause they are with many. But there is no solution in core nor a module on drupal.org which can do that. Pressflow - however - can do this. And it is possible to implement this in Drupal.
Hansel breadcrumbs
While working for Dutch Open Projects I have build an interesting module which enables you to customize your breadcrumbs.
We are proud that we have released this module on drupal.org. This module is sponsored by our client NCRV and is already in use at eerstehulpbijrecht.nl.
Rollback using the PostgreSQL rule system
While browsing some old files I came across a SQL file I wrote around 3,5 years ago. It is a kind of time machine in SQL, originally written for a CMS to implement rollback functionality. It is an interesting piece and I still like the approach with only SQL code. It shows that databases are much more than just systems to store your data.
The idea is that it tracks all changes to a database table. Old versions were stored in an archive, marked by date and version number. That provides us with an easy to see when a row was updated. It’s also possible to see what the content was on a given date. I moved this logic from the application to the database. We want to use the table as if it is a regular table without rollback. It saves a lot of time developing the application, and can be implemented quickly on existing applications as well!
Disallow taxonomy pages
A Google search to "image gallery views cck jcarousel" gives my blog as the first result. But it is not the blogpost, but the CCK tag page showing up. The blogpost itself is not indexed at all, likely cause it's duplicate content.
Drupal did a good job at SEO out-of-the-box. It has a robots.txt which disallows bots to search pages and other pages which could harm your ranking. But it might be a good idea to disallow the tag pages in your robots.txt as well. I have added this yesterday to this site, but it might take a while before it become visible in the Google search results.
How to build an image gallery using CCK, views and jCarousel
Despite the dozens of available modules to create an image gallery, I decided to build it using cck, views, jcarousel, some other modules and one evening. You can see it in action on my image gallery.
The basic idea is that I have one node per album, which contains all images in just one filefield. The node view displays the carousel with the thumbnails, which links to the bigger images using a lightbox. Then I have to make a page displaying the gallery nodes.