Drupal views

Drupal views

The Packt publishing book Building powerful and robust websites with Drupal 6 does not even mention this module, so we are now stepping beyond the beginners guide to Drupal. Because Drupal stores its content in a database, perhaps the most succinct definition of this module I've seen is An SQL front end with Theming. This becomes obvious to anyone familiar with SQL queries as the example below of a simple Drupal view demonstrates. So up to this point you may be forgiven for thinking you were constructing a web site, in fact you are entering (create content) and retrieving data from a database.

As an analogy, consider a library. The racks and shelves of the library are the equivalent of Drupal menu structure, while the books are the Drupal content. To locate a particular book, you go to the relevant rack (e.g.) fiction, then the shelf or subsection (e.g.) science fiction, and retrieve the book you want; and that is more or less the way a website works to.
Now suppose the book you are looking for is not there. You might then query the libraries database, and find all copies are on loan, so instead you query what other books the author has written. This is essentially what Drupal views are about. They provide an alternative ( and complimentary) way to present or manage the information you need. There are a number of pre-built views (or database queries) you can use, or via the views module, customise for a particular purpose.
While some custom views are undoubtedly useful to general users, but like any database, views (or SQL queries) are especially important from a maintenance point of view. Note:Views can be attached to the menu just like any other content item.