[development] comments as nodes

Robert Douglass rob at robshouse.net
Mon Jun 4 15:56:52 UTC 2007


Since it came up, I'll draw everyone's attention to the nodecomment 
module which makes comments into nodes. Rather, it uses one node type to 
be the comment type of another node type. To me (and the other 
Lullabots) this makes a lot of sense. All that is needed is a 1:n 
mapping between a parent and its children and some special display. What 
makes the nodecomment module really special, however, is that the 
rendering of the "comments" is handed off to the views module (which is 
a requirement), so you could display your comments in totally 
non-traditional ways, such as in a table or in a calendar.

One of the most useful applications that this module has found is also 
the impetus for its creation: voting widgets in the comments that vote 
on the parent node. I'm creating a site, for example, where the comments 
are all ratings of the parent node, and each comment needs to have four 
separate fivestar widgets. To do this, the comment node type has four 
CCK fields from the fivestar module where the target of the voting is 
set as arg(1)... meaning the fields belong to the comment nodes but the 
votes belong to the parent node. Very cool.

We've had clients who have requests like wanting to promote comments to 
the front page, or rate comments, or categorize comments etc. This 
module fills those needs.

The release says it is beta, and I stick by that, but it is worth noting 
that this beta code probably serves 5 million page views a day or more 
on live (rockstar) websites.

-Robert

http://drupal.org/project/nodecomment


More information about the development mailing list