General concepts

Last modified: March 7, 2008 - 17:44

This topic assumes you have Drupal installed and created some content successfully. You now want to build the website you have in mind but don't know where to start. At this point it may help to know more about some central concepts.

What is a Node?
The main building block of Drupal is a node. The word 'node' does not suggest that it is a part of some network. On the contrary, you should think of a node as a single puzzle piece that is placed onto the site by one of your users, or even yourself. A node can be part of a forum, a blog or a book, and by using the Content Construction Kit, you can create as many custom node types as you want. Remember that each node has a type, referred to as a Content Type. It also has a Node ID, a Title, a Body, a creation date, an author and some other properties. It is stored together with all other nodes in one big "shoe-box" known as a "table" in your database.

Drupal has many tables, I think the core has some 50 of them. You may want to explore them on your own site to get a better idea.

Users have their own table too, and some of them are authors of nodes. So nodes do have relations. The only way to find those relations is by searching the whole table until you find all matching items. Luckily the database server is very fast.

Each node can have an unlimited number of comments. Comments are stored in a separate table. To find all comments on one node the server will search the entire comments table.

How do Nodes work?
Look at the address bar of your browser. It probably says http://drupal.org/node/19828. This is the Drupal way of saying "Load all pertinent information for node 19828, including whatever relations (comments, users etc.) are to be shown". This is called a database query.

Most queries in Drupal are hard-coded in modules. /tracker searches all nodes and sorts the result by date. This also works for your site, as long as you enabled the tracker module.

When you hover over the menu and meanwhile read the links in the status bar you get a quick idea of possible queries. Because Drupal mimics a directory structure you maybe didn't know it was a query until now!

Drupal modules perform a lot of operation on the data. For instance when you open a page which you have written yourself you see a view/edit tab on top of the page. This tab is not shown on other pages. This is automated behavior defined by the user privilege settings.

Menus and Blocks
Menus are displayed in blocks. Blocks are the columns at the left and/or right site of your web page. First be sure to enable the menu module (blocks module is always enabled). You will get a menu item in the admin menu. As of 6.1, menu module is enabled by default.

All modules come with default menu items. Often you only will need to enable them. You can change its location in the menu tree by setting its parent and you can change its title if you wish. In all cases it will only show up when you have rights to view the content. E.g. the admin item is not shown to visitors.

You can also create custom items (add menu item tab). You will need to provide a path to the content. Go to the page you want to link to (e.g. via recent posts) and look at the address bar. By default the address next to the domain name will begin with '?q='. When 'clean URLs' is enabled you will see a directory structure. Anyway, you need to copy-paste the right part of the address without the domain name and without the "?q=". This is called the local or relative path. (But as I mentioned, it's a database query mimicking a directory structure.)

By the way, if you change your settings to 'clean URLs' you may also want to change the "default front page". That can be your forum main page 'forum' or a custom made page 'node/15'.

'Navigation' is the default menu, but you can create more as you like. You will need to activate a menu in the blocks settings to tell if, and also where, you want those menu to be displayed. Next you can move menu items to it by changing the item's parent property.

You also can create custom blocks. You can type the html code yourself so you have complete freedom.

You will soon discover the menus and blocks will not give you all you need. The main problem is that a menu item can point to a single node or to a list of nodes of one type, organized by date. In other words, you only can create links that have a fixed meaning, defined by the modules. And you want more of course! For that reason you will need modules that create structure. Examples are:
- books
- stories
- search
- taxonomy
- archive

See also

 
 

Drupal is a registered trademark of Dries Buytaert.