Drupal 6 Views Attachment

Drupal 6 Views Attachment

It's been a long time since I've blogged here — I've been very focused on other business ventures, but alas, I am back. With my return to Blogging about Drupal I've brought along a book review for a recently published book Drupal 6 Attachment Views by J. Ayen Green. (The book was provided to my by the Packt Publishers to review.)

If you've done any work with Drupal you are probably familiar with the very powerful set of modules under the umbrella's of CCK and Views.

CCK allows you to define an unlimited number of fields for any given page type -- which for example can turn a typical page with "Title" and "Body" fields into a full blown vehicle chart for cars in a car dealership with fields for VIN, Make, Model, Trim.

Views allows you to display data from multiple entries in a list, table, grid, etc. With Views you can sort and filter the data to show whatever whatever fields in whatever format you desire — in short, it's a GUI which is capable of building a complex database query and theming the output in numerous ways.

With Views attachment you are not limited to displaying one list, table or grid of data on a page, but rather you can create several different views and stack them on the same page. I can create one primary View of a data set and attach a secondary view to display the same data in a different fashion.

In Drupal 6 Attachment Views, the author uses a real world website development project to demonstrate many different ways to use Attachment Views. The book uses step by step instructions along with hundreds of screen shots to take the reader through each Views Attachment example.

What you quickly realize is that using Views Attachments can take your projects to a whole new level — adding powerful interactivity to your once static or simplistic, single dimension Views.

For example, your primary view might be a list of books sorted by category and the Attachment View, to the right could be the list of categories. It is possible to make the list of categories into links, clicking on them passes the category ID (via the URL) to the primary View which is updated to display only the books within that category.

My above example only scratches the surface of what is possible with Attachment Views — but makes it easy to see that if you are into Views, this book can help make you a power user. The book also touches a bit on theming (don't run away screaming, theming is very important) and module development (although it really doesn't appear to apply to Views Attachments at all).

Although the book was helpful, I did have quite a few frustrations as I read through the chapters.

If you're like me, you spent many of your childhood years putting together complex Lego monstrosities, working through the instruction books page by page, following the step-by-step renderings. I found this book to be a lot like that, but I found myself constantly skipping to the end of a chapter to find a visual of what the heck I was building — and most often times there was no 'visual' of the final product. And when there were screen grabs, there often wasn't very much sample data to get a good idea of the final product.

Since most of the book was like a Lego construction booklet, the real value often times was hidden in the side notes (unless you've got a construction company and want step-by-step instructions to make your own website).

Don't get me wrong, I learned many things about Views and have given a lot more thought as to how I can use them on future website development projects. Drupal developers with as much experience as I have would be better served by fewer literal step-by-step instructions and more conceptual instructions. For those just testing the waters of Views, this will give you a great introduction.

You can get your own copy of the book here at Packt Publishing

Tags: