The Deal With Nodes

Printer-friendly versionPDF version

Every so often I'll get a question from a user who is new to Drupal about nodes. "What is a node?" they want to know. Nodes are explained on Drupal.org as, "...any posting, such as a page, poll, story, forum text, or blog entry." That description is close but not every post on a Drupal site is a node. Comments (as the Drupal.org item mentions) are not nodes. Neither are user profiles.

The Difference Between Nodes And Other Content

Nodes contain at a minimum a title and most likely a body (or description) field. You actually have the option to not use the description field at all. All standard node types on a Drupal site contain a title and a body. You can add additional fields  (like email address, date or url) to your node types using the Content Construction Kit (CCK) module. You can create new node types altogether by using the core feature located at admin/content/types/add. This allows you to create a new type of node which can be customized by utilizing CCK.

Other content, like comments, profiles or the registration form, won't necessarily contain a title and body field. Another difference is that other content may not be indexed by the standard Drupal search functionality. User profiles are not indexed by Drupal search. Neither are items captured by the core aggregator module. Comments are indexed by Drupal search as a standard feature starting with Drupal 6.

Two more important node features are comments and attachments. Comments can be enabled (or disabled if you like) for every node type. Likewise you can attach files (like documents or images) to nodes as well. Finally, the standard Drupal statistics system will only keep track of node views.

What This Means To The Drupal Site Builder

So you've got these nodes and there are these other types of content floating out there. How does it affect how you build and manage your site? There are a world of options available when it comes to nodes.  So you  really need to consider the limitations of the types of content that aren't nodes. Let's look at the case of user profiles.

User profiles are not searchable and cannot be customized by CCK. If you don't plan to rely on user profiles as an important feature of your site then you probably won't care about this issue. Those that do care about the issue usually look for a work around like a nice contributed module. The content profile module can help you make profiles available as nodes.

Imported content is another issue. The standard aggregator module lists imported items but does not offer a permanent link, search indexing or the ability to add comments to the items that you have imported. If you really want to build your site around aggregated content then you will probably want to investigate contributed modules like Activity Stream or Feed API.

There can be a down side to turing certain types of content into nodes. As you add more and more content as nodes your site performance could be negatively impacted. So the balance between everything as nodes and the potential performance and maintenace issues should be considered.

How To Know When You've Created A Node

You know that content is a node when it is created by going to the node/add link on your Drupal site. I mentioned that for two reasons. First, it's a simple way to know if a node is created. Second, it's because pages don't necessarily have to be nodes.

There are pages that are created by going to the link node/add/page on your site. Those pages are nodes. They will be indexed by search, can have file attachments, comments, etc. You can also create a page which contains a list of nodes by using the Views module. It is very important to understand that distinction.

Why You Might Not Care

If you're building a very basic site that simply relies on the standard content types (like blog, page, story, poll, forum post) then whether or not content is considered a node should not be important to you. If that's the case then have no worries.

As I stated above it could become an issue if you plan to do more complex things like making use of imported (aka aggregated) content and complex user profiles.

Comments Welcome

Since this is a blog post, which means (hooray!) it's a node, you can and should leave comments if the concept continues to confuse or otherwise perplex you.

Bookmark and Share Bookmark or Share Post

Comments

Anonymous's picture

Your "you can and should leave comments is the concept continues to confuse or otherwise perplex you." still confuses me. lol

I think you mean to use "if" in place of "is".

Thanks for the post, it's of great help to me.

learnbythedrop's picture

That was a typo that I missed. Thanks for pointing it out as I've since corrected it.

Re:
Anonymous's picture

But /Drop on your domain seems to be a node ..How have you change the name.

Vini

learnbythedrop's picture

You can use the Pathauto contributed module to alter the path to nodes. I renamed the blog content type to "drop" and then instructed pathauto to generate a path that includes /drop. http://drupal.org/project/pathauto

Post new comment

Google Friend Connect (leave a quick comment)
loading...
The content of this field is kept private and will not be shown publicly. If you have a Gravatar account, used to display your avatar.