Drupal Fundamentals
What the hell is this Drupal thing anyway?
Drupal is a content management system, and it manages content, of course. But what does that actually mean? How does Drupal manage content? What are its basic building blocks to achieve this goal?
I had to introduce Drupal to a couple of webmasters who had never worked with it before. They had researched it themselves, and another Drupaler had tried to explain it to them as well. Even so, they still did not understand what it was about.
Drupal’s own documentation is not very clear about the fundamental building blocks that compose a Drupal site. Their documentation focuses on what sorts of web sites Drupal can become, to development practices about modules and theming. There is not much in between to inform the average webmaster how to approach Drupal.
The fellow Drupaler, as I am told, focused on the module system. This is a very common approach from Drupal developers. The module system is a great advantage for Drupal as a content management system - but a module’s only true value is to add features. You do not create a website from features, though.
No, the building blocks of a Drupal site are not its modules, it is its nodes, views and users. The modules then add extensions and features to these core aspects.
Nodes
When you break it down, a node is essentially an object of information. It is composed of separate pieces of information, ‘fields’. At its most basic level those are ‘title’ and ‘body’. Modules are then added to the system to expand and add more information to the node (such as text and images).
You can have different types of nodes, called ‘content types’, each with its own set of fields. On this particular site, I have a content type called ‘web portfolio’ and one called ‘blog entry’. The web portfolio content type has many fields for adding screenshots, date, roles, URL, etc. While on the other hand, the content type used to create this page you are reading is much more simple with just a title and body field.
Even though the web portfolio entries and blog entries look different and behave differently, they are still all nodes. What you are reading now is a node.
Views
A view is a collection of nodes sorted in a particular fashion, filtered to display only the types of nodes desired.
The link on my website that brought you to this page was generated through a view. The ‘Dev Blog’ link is a view of all ‘blog entry’ content types sorted by created date with the most recent on top.
You can even sort a view by fields. The ‘Web Sites’ link is a view of all ‘web portfolio’ content types sorted by the field in which I entered the date the site went live.
Views can be entire pages, blocks, or embedded into nodes. The homepage lists the most recent blog entry in a block. The album node view under ‘Photography’ embeds a view to list all photographs associated with that album.
Users
Users are how visitors interact with the site. They can be either anonymous or authenticated (registered with an account). Authenticated users can then be grouped together by ‘roles’.
Why is this important enough to be a fundamental building block? Because you cannot forget about access control! Drupal has a very powerful access control system. For many websites the developer has to keep in mind what content is accessible to whom.
You can create admin related pages (for example, I have a view to display all nodes I have flagged as drafts) or give increased permission for registered users like commenting or voting. Roles could be created to allow some users to be moderators, and other users could be editors. For one website, I had a customer role that allowed them to access documentation of the products they purchased.
In the end, I feel, that the module system is not part of the fundamental building blocks of developing a Drupal site. It adds features but it is the building of nodes, views and users that actually creates the site. Modules expand upon the possibilities of what you can do with nodes, views and users - understanding that development approach is important for those first getting into Drupal.
