DrupalCampLA 2009 - Views Demystified
What is Views?
A module that can be used to create fancier lists than the ones that come out of the box from Drupal.
These lists can be seen in many different ways and forms, such as:
- an RSS feed
- a replication of the front page story feed, with different requirements for display
- a list of users
- a fancy styled block that randomly rotates one item from a specified list
- specific views that you would like for administrative purposes only
- etc.!
Working with Views and some CSS magic is similar to what Chris Charlton says about building sites with PHP: the limits are (mostly) your imagination and your time.
Drupal.org describes Views as:
"This tool is essentially a smart query builder that, given enough information, can build the proper query, execute it, and display the results as a page, block, or other format such as an RSS feed."
A note: there is always more than one way to do everything. My way is how I figured it out on my own. There may be better ways. If people know of better ways, please add them as comments on this page!
The Presentation
The presentation was recorded, and can be viewed online here:
http://replay.nacs.uci.edu/public/summer2009/DxLA/Views%20Demystified%20-%20Web%20(1024x768)%20-%2020090808%2005.17.00PM.html
Additional Resources
A decent Views 2 Introduction/Tutorial:
http://drupal.org/node/395064
Views Module:
http://www.drupal.org/project/views
Comprehensive Tutorial from Matt Petrowsky
http://gotdrupal.com/videos/drupal-views-tutorial
Fun module for slideshow-y type rotation: Views Rotator
http://drupal.org/project/views_rotator
A few "cautionary" reminders
Be careful to override your defaults when changing settings for a specific display. If what you are changing is italicized, it will change your view's default settings! Override and make sure it is not italicized before editing it.
Changes you make to your view are not saved on "update" - they are saved on "save." If you have not pressed save, or if any of your settings are highlighted in pale yellow, or your view says "Changed View" in the top right, you may lose your work if you navigate away, and your work has not actually been stored.
Your views send queries to a database and the database returns content. If you have a lot of fields, this can create a performance hit. Consider this when deciding what your view actually needs to have in it.




Comments
Thanks for the great presentation
We just watched your video on views. Really helped us.
Thanks.
glad it helped!
Glad to hear that the session was helpful. Doug Vann and I have teamed up to propose a 2-parter at DrupalConSF if anyone is looking for more. Vote here:
http://sf2010.drupal.org/conference/sessions/views-demystified-1-part-2-...