Drupal theming: theme_node vs. node.tpl.php

Posted: July 30th, 2008 | Author: admin | Tags: | No Comments »

So I’ve been incredibly frustrated trying to theme Drupal 5.x over the past few months.  Now, I’ll admit that this was my own fault, but the problem I ran into isn’t very clearly documented anywhere, so I figured I’d post the explanation here so that anyone else Googling it might be assisted by my hard-won wisdom:

theme_node OVERRIDES node.tpl.php files

There.  That’s it.  I had created a theme_node implementation in my template.php file in order to customize the node display, and forgotten about it.  Later on, when I tried to create node-nodetype.tpl.php files to customize the appearance of each type of node, nothing worked.  I tried everything.  I wound up just giving up.  Until finally, today, I absolutely needed to change something in the HTML in order to add some Javascript functionality, so I dug in, and managed to find the solution in a description of the way PHPTemplate works here.

Nowhere in the theming docs on Drupal.org is this mentioned.  It’s not mentioned in the API docs for the theme_node function either.  So now you have it in writing.

What this means, in practical terms, is that you should NEVER write an implementation of theme_node.  It’s less MVC than using a template file, it’s less flexible for displaying different node types differently, and it has the potential to trip you up down the line if you forget it’s there.  Just use the template files.  For sanity’s sake.


Web design in the “real” world

Posted: July 21st, 2008 | Author: admin | Tags: , , | No Comments »

Sometimes web design doesn’t happen on the web: witness user lamedust’s video from instructables.com:

What does this have to do with web design, you ask?  One of the things I want to communicate through this blog is my belief that web design, properly speaking, is the architecture of channels of communication.  Designing for the web is creating environments in which people interact, no matter how simple or complex that interaction might be.  Yes, they interact with the content, which is why web design is so often confused with graphic design.  But they can also interact with the content creator, and with each other, and these modes of interaction are far more powerful and far-reaching.

One of the key discoveries that this view of web design has yielded in recent years is that if you lower the cost of interaction to zero, and get the job started, anyone with even a passing interest in what’s being done can hop in, do a tiny bit of work (fix a bug in Linux or Firefox, correct grammar or spelling in a Wikipedia entry, tag a photo on Flickr, etc.), and then go on their merry way.

These modes of interaction create impressive results that aren’t attributable to any specific person, or organization, they’re “crowdsourced”.

What lamedust has done is figure out one of the (theoretically infinite number of) ways in which this design vision can be applied to non-cyber-space (otherwise known as the real world).  Start a project, make it ridiculously easy for people to help, and make it so that their efforts can be aggregated.  Voilà!  Free haircut.


Brand new blog

Posted: July 16th, 2008 | Author: admin | No Comments »

Hi all.  This blog will be a clearing-house for my ideas on web technology and design, mainly focused on the design of ’social software’, and the societal and political facets of said design and technologies.  I also have a “microblog” on music at newsound.tumblr.com, where I’ll post songs, music videos, concert reviews, etc.  The recent posts from that blog will show up in the far right-hand sidebar of this page, via the magic of RSS.  You can find me a bunch of other places on the web, and I’ll try to maintain a list of those places here, to keep everything nice and tidy.

So, until my first ‘real’ post, keep well.  Peace.