Book Image

Drupal 6 Attachment Views

By : J. Ayen Green
Book Image

Drupal 6 Attachment Views

By: J. Ayen Green

Overview of this book

<p>The Drupal View modules give you the flexibility and freedom to customize the display of your web site's content. Defining custom content types is easy; however, it's also possible to use various content types in a complementary manner on the same page! Attachment displays in Views (also known as Attachment Views), are a way to customize your web site with multiple displays that interact with each other and turn a nice site into a spectacular one.<br /><br />This hands-on tutorial will teach Drupal developers across the experience spectrum how to use Attachment displays in Views, to make quick progress in functionality and added-value to users! 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 and views within a view.<br /><br />This book starts by introducing Attachment Views as reader activities. Here, we create a single Attachment View and take a closer look at giving each page an interactive feel. It also shows you to create a View with an Attachment View. Later, using practical examples, it helps you to develop a 3-view composite display using two and three custom content types. You will also be able to develop a composite display using multiple Attachment Views, to provide a control panel of sorts from which you can view the various content types. Finally, we will put the home page together making use of Views, blocks, a flash slide show, and other pieces.<br /><br />This book provides several examples of introducing additional displays onto a web page, and having them interact with each other. The result is pages that provide several types of information and behave more like a desktop application, increasing the value to your site visitors.</p>
Table of Contents (17 chapters)
Drupal 6 Attachment Views
Credits
About the Author
About the Reviewers
Preface

Adding a Contact info Attachment view


With our contact form complete, it's time to complete our Contact Us page. We're going to add an attachment display to the Contact Us view that will provide other contact options. Actually, we have other options available to us. We could create this display as a block, or, since our current view has no node to display and the additional contact information will be a node, we could just have it shown by the existing Page display.

We'll use an Attachment display instead of a block display simply because we don't want to use one of the block regions for the output, and we're already using the Content region for a block (the form). We've chosen not to use the Page display because it's easier to theme the output with one part of the content being a separate display. Then, its content is provided in a separate variable for us, so we'll use an Attachment display.