Drupal 6 Attachment Views, by me, J. Ayen Green, is my second title from Packt Publishing. It is aimed at Drupal web site developers who want to build more functionality and interaction into their views, but aren’t ready quite yet to take on panels. As a reader of drupal.org, you can receive a 15% discount (see below) and benefit the Drupal Association!

I wrote this to be a fun, informative, hands-on learning guide. It uses actual case study that was developed in parallel with the book’s writing. This guide presents purposeful and interactive examples that build on each other. Clear, concise instructions and practical examples help you to learn quickly to use this exciting feature of views.

Some of what you will learn

  • Quickly learn about painlessly increasing the functionality of your Drupal 6 Web site
  • Get more from your Views than you thought possible
  • Provide more functionality to your site visitors without a technology change
  • Create composite displays to increase and vary the information you can provide
  • Enable dynamic displays using multiple content types, so that related content can be displayed simultaneously
  • Develop views with record menus
  • Create static and interactive displays, to provide additional information to the user

About the book

Views are a common way to display a collection of similar content types on one page. What do you do if you want to display different content types…simultaneously? What if you want to allow a user to interactively select which content they want, without using a menu? You can actually have more than one display within a view…views within a view. These chapters provide several examples of introducing additional displays onto a web page, and have them interact with each other.

You will learn how to use an Attachment display to act as a content menu, from which to select specific content to view in another dispaly on the same page. You will also learn to use Attachment displays as a type of callout, in which additional information is provided to the user. Sometimes, there is a logical connection between different content types, and you will learn to use Attachment displays in conjuntion with the view relationships capability to show both the main content and related content of a different type all on one page.

The result is pages that provide several types of information and behave more like a desktop application, increasing the value to your site visitors.

Get 15% off!

I have secured an exclusive 15% discount for you when you buy through PacktPub.com, just enter the discount code Drupal6AV15 (case sensitive) to the shopping cart. As with all of Packt’s Drupal books, Packt will be donating a percentage of its sales to the Drupal Association.

About the author

J. Ayen Green is a software and web site developer, writer, poet, and Drupal nut. He has published a number of books, papers and poems under various pen names. He and his wife, Sofía-Aileen, make their home in New York City.

Comments

VM’s picture

congrats Jeff

scottatdrake’s picture

Wow, I know Views attachments are powerful but... an entire book about them?? Cool. I look forward to seeing what I've been missing.

rogerpfaff’s picture

does the book cover the views module in general? there are so many possibilities that should be explained in book too.

---
Want to exchange with the community in chat for free and archived? Join us on drupalchat.me

VM’s picture

Other books on views already out or due out. One by the module developer himself, I think.

rogerpfaff’s picture

the only book i can find about views is for D5 and I guess that's not covering the enhancements of D6 Views.

---
Want to exchange with the community in chat for free and archived? Join us on drupalchat.me

VM’s picture

correct it wouldn't. I was thinking of the DVD from lullabot for views 2. There is mention of views in other books but not one specifically for views. Merlin was authoring a book though I can't remember if it was panels or views. I'd think views but have no confirmation.

ardr’s picture

@VM - I've just spotted this new Drupal book, due to be released on July 19 according to amazon.com, and August 19 on amazon.co.uk:

Title: Drupal's Building Blocks: Quickly Building Websites with CCK, Views and Panels
ISBN-13: 978-0321591319
Authors: Earl Miles, Lynette Miles

There is a 'rough cut' early draft available via the Safari electronic publishing system via this page on the publisher's web site, which also includes a synopsis of the book and a table of contents.

Rather than wait, I might be tempted to buy the rough cut version - anybody else tried this yet?

Regards,

Alan

VM’s picture

Yep. Earl Miles = merlinofchaos. Developer of Views & Panels (among other drupal modules)

gpk’s picture

Hmm, amazon is now reporting that this isn't available until November 2010 :-( ..

15 Nov in US, and 5 Nov in UK.. anyway I've pre-ordered a copy at 50% off.. :-)

gpk’s picture

sidharth_k’s picture

I purchased the electronic version of this book recently: I liked it. Attachment Views are indeed powerful and I can see why the author decided to write a book on it.

On the minus side, I found that the author leaps into constructing the views without adequately explaining in the beginning of the chapter what his objective is. I need to go to the end of the chapter, see the final result screenshot and start reading from the beginning of the chapter. Another point, his examples could have been fleshed out a little better -- with more sample data showing on screen shots than one row for each view. Having more than one row in a view helps you visualize a little bit more about the functionality being constructed.

Lest I come across as overly critical I want to say that I _did_ learn many powerful techniques in views attachments. And I _did_ like the book overall.

3.5 / 5 stars from my side.

Pedro Lozano’s picture

For when a complete Views API book for developers?

Too many end-user drupal books but the current best seller still is "Pro Drupal Development". Will we ever see something like "Pro Views Development"?

adrianmak’s picture

I'm looking for another big topic of drupal, Form API , if possible ^^

Old Man’s picture

the second edition of PDD was published in August, 2008 (probably finished editing in June), Third edition PDD for Drupal 7 is already out and D7 is still in alpha! So any changes won't be reflected. It may be a good reference book, but I'm not into debugging someone else's code.

ardr’s picture

he second edition of PDD was published in August, 2008 (probably finished editing in June), Third edition PDD for Drupal 7 is already out and D7 is still in alpha! So any changes won't be reflected. It may be a good reference book, but I'm not into debugging someone else's code.

I agree with this completely, although I'm a book addict so I end up buying them anyway :-(

This is a good argument for electronic editions of Drupal books, and authors being nagged to keep them up to date as they are fed with errata & updates by readers.

Having recently started my Drupal learning curve, I've found it very frustrating at times that examples and screenshots in Drupal books don't match what I see on my screen. While you're learning something for the first time, you're perpetually in doubt as to whether the book is out of date or you've just done something wrong or misunderstood it. This wouldn't be so bad if publishers weren't so tardy in publishing updated reprints.

muhleder’s picture

I'd have to respectfully disagree completely, for Pro Drupal Development at least, can't comment on the other books. PDD is pretty much essential, and I haven't personally found any differences in the first two versions, but maybe I've just been lucky?

Edit: when I said differences I probably meant discrepancies, ie I haven't noticed anything not functioning as described with either the D5 or D6 editions of the book.

ardr’s picture

@muhleder - I haven't yet purchased 'Pro Drupal Development', but it's on my list & will soon be buying it. My impression from reading extracts via the amazon.com 'look inside the book' facility is that it's written to a high standard and the publisher has invested a lot in producing a high quality product. I already have the book 'Pro Apache' by the same publisher, which is up to the standard I expect & I value it as a reference book.

I was probably referring more to the Packt publishing series books on Drupal that I've bought so far. I don't know whether the ones I have are typical, but I get the impression that this particular publisher doesn't invest enough in proof-reading as well as general editorial work (even elementary spell checking of garbled text gets omitted sometimes). In my previous life as a C/UNIX product developer I was used to well-written books published by the likes of Addison-Wesley and O'Reilly, and, compared to these, a couple of the Packt books I've used have a rather amateurish/sloppy feel in terms of the editorial & production values. Maybe my expectations are unrealistic? I view Drupal as an industrial-strength toolkit which deserves industrial-strength books.

Sorry if this comes across as rather negative, but I'm really enthusiastic about Drupal as a web devlopment toolkit, and I'm hungry for information on it - the more books that are published the better. I realise that Drupal is a moving target but I think that I' not being totally unrealistic in wanting good books on Drupal 6, which seems to be the most popular release in use at the moment and isn't going away any time soon.

KR

Alan

matkeane’s picture

Hi,

I've already bought PDD for D5 and for D6 - and I'll no doubt end up buying the D7 version, as they are very useful, detailed references to the complex inner-workings of Drupal. According to the publisher's site, the new edition will be published in April and, although I guess that means that editing is probably finished, the fact that we're in code-freeze on D7 should mean that there aren't any major API changes that won't be reflected in the book. I hope the publishers will take the same approach as the Drupal community and release it "when it's ready" rather than on an arbitrary date.

In any case, since PDD is aimed at developers, there tend to be less UI screenshots in it than in some other books, and so less chance for discrepancies. The Packt series - while not wanting to knock them as there are some good titles in their Drupal series - tend to take a more hand-holding approach, which can be a bit frustrating if you're used to the O'Reilly or PDD style of book. As an example, I bought the Packt 'Drupal 6 themes' book, but found it less useful than the single chapter devoted to theming in PDD. Having said all that, the Packt 'Views Attachments' title sounds interesting and, since PDD tends to concentrate on core Drupal APIs, it's unlikely to cover that topic. It's horses for courses.

Old Man’s picture

I was concerned that this book was released "too soon" trying to reap the dollars before any other similar book could. I did read a few reviews about code issues, and deprecated commands, but the vast majority of the reviews I've read (and I did read many) were positive. I am pretty new to Drupal and am looking for good reference books. O'Reilly's book I've found to be a great help to get started, but need something deeper now.

ardr’s picture

wrote

O'Reilly's book I've found to be a great help to get started, but need something deeper now.

If you're looking for an in-depth reference book, then Pro Drupal Development, second edition, looks very good. I've just purchased this because, despite being relatively new to Drupal, I like to know a bit about how a product works internally. It looks well-written with plenty of diagrams (even flowcharts!) and is professionally produced. The author keeps the code samples and errata pages up to date on the companion web site, which includes a link to a free downloadable PDF copy of chapter 1 as a taster.

I have a lot of experience in selecting & using technical books, and just skimming through this gives me good vibes about the amount of effort that the author has invested in it, and his conscientious attitude. This isn't necessarily a book to read straight through from start to end, but read in small digestible chunks as needed. It's written for Drupal 6, which I'm sure I will be using a lot before going anywhere near Drupal 7.

HTH

Alan

j. ayen green’s picture

This is my second Packt title, and I don't recall any comments about bad editorial work in the first one. I certainly spent a tremendous amount of time reviewing the pre-final and final versions, along with the editorial staff, and hopefully caught most everything. That said, there was a magazine that came out once, a major fashion title, that went through all of their editorial process and hit the stands with the title "Summmer." Sometimes things slip through. Perhaps it would be more appropriate to wait until -after- you've read it. Just saying.

adrianmak’s picture

PDD 1st edition is focus on D5, 2nd edition is focus on D6, the new up coming edition is focus on D7.

tanoshimi’s picture

Errr... Old Man: 3rd edition of PDD is not out yet, and is currently not scheduled for release until May. The PDD books have been excellent so far, and although there may be a few issues regarding typos in code, they are generally of excellent quality. Not surprising, when you look at the author list - check out what these guys are responsible for:

http://drupal.org/user/2275
http://drupal.org/user/2375
http://drupal.org/user/53892

gpk’s picture

>Third edition PDD for Drupal 7 is already out
Perhaps you are thinking of Beginning Drupal 7 by Jacob Redding. See http://drupal.org/books.

hailander’s picture

looking for the same thing , i struggle always coding with views .

2c’s picture

Is there a table of contents available for 'Drupal 6 Attachment Views'? I've searched Packt and Amazon with no luck.

j. ayen green’s picture

Chapter 1, Something Old, Something New, contrasts the capabilities of a standard Drupal website to what will be achieved in the book, and in so doing, the rationale for the book is presented.
Chapter 2, Attachment Views—A New Beginning, introduces Attachment Views as reader activities. Each View created would be able to stand alone, but will then have a single Attachment View created to give each page an interactive feel.
Chapter 3, Interactive Page Regions, continues with single Attachment Views. In addition to creating another view and Attachment View, a small module will be created to provide the e-mail functionality needed for contact.
Chapter 4, Additional Displays, helps the reader to create a view with an Attachment View, a Block display, and an additional Page display.
Chapter 5, Bios, will have the reader develop another 3-view composite display, using two custom content types.
Chapter 6, Prior Jobs, will take the reader through another 3-view composite display, using two content types: jobs and bios, and the templates necessary to format it, with one of the attachment views being purely for display. The page will display prior jobs for the reader to select from, and once selected, a separate part of the page will display the job info and the appropriate bio.
Chapter 7, A Different About-Us, we will develop a 3-view composite display using three custom content types. On most websites, this is a static, fairly uninspired page. Here, we will create a composite page so that the bios and prior jobs will be shown and selectable in addition to the company information that will be in a separate piece of content. Cascading View templates will be used for formatting the overall view.
Chapter 8, Control Panel, develops a composite display using multiple Attachment Views, to provide a control panel of sorts from which management can view the various content types.
Chapter 9, Front(Home) Page, puts together the home page; making use of Views, blocks, and other pieces.
Chapter 10, Punch List, addresses the fnal tasks, such as defining roles, users and permissions, site configuration items, and more.

AlanT’s picture

As a relatively low-level Drupal user (meaning, I don't code my own modules -- I just use what others have created), I was always confused about Views. I knew there was substantial power in them, but didn't have any frame of reference to work from.

I just started reading through this book yesterday, and while the writing style is rough and unpolished, I have to say that the graphic at the top of page 13 cleared up a lot of my confusion. By the time I got to page 25, I felt confident enough to 'fix' a view that had not been working right with my Simplenews taxonomy.

For me, this was almost worth the cost of the book by itself, and I know I'll learn a lot more as I read further.

From the comments above, it seems the "Pro Drupal Development" may be more appropriate for me than I had assumed. I thought it was just for module creators.

For reference, this is my 4th Drupal book from Packt Publishing. Others on my shelf include:

  • Drupal: Creating Blogs, Forums, Portals, and Community Websites - David Mercer
  • Drupal 6 Social Networking - Michael Peacock
  • Learning Drupal 6 Module Development - Matt Butcher (I'm planning to get more involved with coding)

This was the first book in the series I felt needed additional work in the editing phase. For example, the screenshot on page 11 is supposed to show a taxonomy term, but doesn't. Also on this page, the author mentions a 'trinity' of modules, but does not list the other 2 referenced. (I spent 10 minutes looking for this, never found it.)

Page 19 suggests that selecting fields is part of an SQL 'where' clause, which is not true. And on page 25, there is a VERY confusing phrase I cannot decipher, "... but the page would name when the user selected a title, ..." How does a page "name", and what is being named?

- Alan Tutt

Exceptional Personal Development for Exceptional People
http://www.PowerKeysPub.com

j. ayen green’s picture

You're quite right about those errors, and that they should have been caught, given the small editorial army involved. Thanks for the catches.

p11 - The 'trinity' of modules are Views, Panels and CCK.
p19 - It should have been 'select' instead of 'where', as shown correctly in the diagram.
p25 - The phrase on page 25 ... 'name' should have been 'change' - no idea what happened there. It's merely stating that clicking a link will cause the page to change.

- J Ayen Green

adrianmak’s picture

If the 15% off including electronic version that will be great

Juliancpackt’s picture

I think its been updated so eBooks have 15% off too.

Juliancpackt’s picture

Actually this Discount code gives 20% off eBook cover price: 'Drupal6AVeBook' (case sensitive)

hansrossel’s picture

For me the book was a bit dissapointing. The views in every chapter are very similar (same kind of lists and url always the same /[nid] structure) and very basic. Above that things could have been explained a lot more compact. Now the book is full of unneccesary large screenshots that fill a whole page and just explain "check this checkbox" (p164) or "remove the label value" (p122) or "do the same with the body field" (p123). I think there are a least 5 pages with each more or less same screenshot for the different/similar views each one taking a full page to explain "remove the label value". Maybe these large screenshots could be ok in a first chapter but for next chapters with similar examples I would have expected that the overview of the view settings (like p196) would have been enough and only explain certain specific element that are different than the previous views.

For me Packt books have a very mixed quality. Sometimes they are just a collection of easy screenshots like this book, Sometimes, like in the case of for example "Drupal 5 Views Recipes", they have a lot more depth and interesting examples and tips.

mroswell’s picture

Thank you hansrossel!

A note that I still use my book for help in Drupal 6 sites. (I just installed a whole forum moderation system using one of my flag recipes, for instance.)

- Margie Roswell, Drupal 5 Views Recipes Author

P.S. I look forward to reading the Drupal 6 Attachment Views book.

JayNL’s picture

My employer ordered this book last week from comcol.nl and it's delivered today... so cool, can't wait to start reading it. Thanks for writing it!

//EDIT

small error on the back cover of this book. The module is called "Views" not "View".

JayNL’s picture

Anybody find the very last 4 pages very confusing as well? It's a complete mess?! It almost looks like the author just forgot about the last few pages?

j. ayen green’s picture

If you mean the final appendix, there is a -very- large select field in one of the content types, with a zillion tiered choices. They wanted all the code that was used, and there just wasn't a pretty way of including that field without adding many pages for no reason other than to make the select options 'pretty.'

J Ayen Green

JayNL’s picture

Well first of all, the book was great and a marvellous resource. We were in dire need to learn about attachment views for a webshop we're building, so your book was a perfect solution to our needs. Thanks a LOT for that Ayen!

I did report this 'error' to PacktPub and even they said this must be wrong :) They even gave me a free eBook in return for reporting the 'error'.

In honesty: those pages look a bit messy and perhaps it was nicer to put that text in a couple of tables with a fixed font. This alignment looks weird...

For the rest of us, please find screenshots attached. The fingers in the photos point to nothing specific, it's just to flatten the book while taking a photo.

http://ep2up.com/uploads/1269520985.jpg
http://ep2up.com/uploads/1269521074.jpg
http://ep2up.com/uploads/1269521090.jpg

Once again, thank you for writing such a useful book. We sincerely hope you'll write another in the future, that's just as useful!

adrianmak’s picture

what a such big mistake

j. ayen green’s picture

If borders being omitted from the formatting of the table in the appendix is the biggest mistake...I'll take it.

Sknight17’s picture

Great book! Everything is detailed and accurate. Does a great job demonstrating Drupal's (not just Views) capabilities and powers.

j. ayen green’s picture

I've added an errata page for this book at the blog. Please review this before beginning activities from the book, in case that activity had an error or omission in print!

http://ayendesigns.com/content/D6-Attachment-Views-Errata

- J. Ayen Green

frecaze’s picture

Tengo el libro en mis manos, y lo voy a leer, gracias por escribirlo :)

j. ayen green’s picture

El gusto es mio. Gracias por leerlo.
-JAG

leob’s picture

Thanks first of all for your book.
I am learning a lot but now I am stuck on chapter 2.

I followed step by step every instruction but I couldn’t make it work. I used the php code described on the book and I placed the view file views-view--subs.tpl.php in the main directory root of the theme.

I included the css file as local.css and it included in the info file from the acquia slate.

I only named the file slightly different changing the S to an small caps but I think it doesn’t matter as soon it is following the theming nformation on the views page.

<?php if (($attachment_before && $rows) || ($attachment_after && $rows)) :?>

          <div class="view-subs-display-container">

          <?php endif; ?>

         

         <?php if (($attachment_before && $rows) || ($attachment_after && $rows)) :?>

          <div class="clear-both"></div>

          </div>

          <?php endif; ?>

 

Any help will be great!

Best regards

edited by silverwing - added code tags

VM’s picture

did you clear the theme registry after adding new tpl.php files and altering the theme.info file?

leob’s picture

Never mind I solved anyway.

VM’s picture

in future it's helpful if you mention HOW you fixed it so that others who may find this thread benefit.

j. ayen green’s picture

I'm not sure what problem you were experiencing, other than it didn't work, nor what you did to fix it, but I can tell you that changing an uppercase to lowercase letter in a filename in Linux -does- make a difference. In the case of Drupal, the template filenames (hints) are generated based on something else, such as content type, view name, etc., so if you change a letter to something that doesn't match the source of the hint, the template won't be used because the theme system won't be looking for it with that name. The same goes for using one hyphen instead of two, or vice-versa.