Search icon
Cart icon
Close icon
You have no products in your basket yet
Save more on your purchases!
Savings automatically calculated. No voucher code required
Arrow left icon
All Products
Best Sellers
New Releases
Learning Hub
Free Learning
Arrow right icon
Over 7,000 tech titles at $9.99 each with AI-powered learning assistants on new releases
Drupal 5 Views Recipes
Drupal 5 Views Recipes

Drupal 5 Views Recipes: 94 recipes to develop custom content displays for your Drupal web site

$32.99 $9.99
Book May 2009 412 pages 1st Edition
$32.99 $9.99
$15.99 Monthly
$32.99 $9.99
$15.99 Monthly

What do you get with eBook?

Product feature icon Instant access to your Digital eBook purchase
Product feature icon Download this book in EPUB and PDF formats
Product feature icon Access this title in our online reader with advanced features
Product feature icon DRM FREE - Read whenever, wherever and however you want
Buy Now
Table of content icon View table of contents Preview book icon Preview Book

Drupal 5 Views Recipes

Chapter 1. Introduction to Views

In this chapter, we'll create both a page and a block using the Views module. We'll install Views, and introduce the Basic Info, Page, Block, Fields, and Filters fieldsets. We'll have a chance to further observe every available Views UI fieldset in Recipe 9. The Views Worksheet in Recipe 10 summarizes the whole interface, and will help you track your learning throughout the book. While most chapters lend themselves to a pick-and-choose approach, I encourage you to complete each recipe in this chapter.

Let's Begin!

Recipe 1: Installing the Views module


Ingredients *

Drupal 5:

Host login access


Views UI: contained within the Views module

*These ingredients are prerequisite for all of the recipes that follow, and will not be listed in subsequent ingredient lists.

The Views module has a straightforward installation, much like other Drupal module installs. The following recipe instructions incorporate a mix of Windows tools and the command line for locating files, creating directories, downloading files, and unzipping them. Consider following the recipe, but feel free to substitute file management approaches specific to your operating system and preferences. This recipe is followed by a page listing helpful command line shortcuts that you should incorporate into your practice if they are available on your host.

Finding or creating the <DRUPALROOT>/sites/all/modules directory

  1. Log in to your web server. You will need to know your host name, login name, and password.

  2. Locate the Drupal root directory on your server (a common directory location is /home/your_account/public_html).

  3. If this is the first contributed module in a brand new Drupal installation, you will need to create the modules subdirectory.

    • From your Drupal root directory, type the following to change into the <DRUPALROOT>/sites/all directory:

      cd sites/all
    • Make a new modules directory:

      mkdir modules
    • While you're there, you may as well create the theme directory, if it is not there already. We will use this directory in Chapter 7, Techniques for Theming Views

      mkdir themes
    • Now change to the modules directory:

      cd modules

Downloading and uncompressing the module

  1. Open the browser of your choice.


    Most of the screenshots in this book use the Firefox browser—a popular choice for many developers. Recipe 8 covers Firefox installation.

    Go to, and read the page. There are several different versions of Views available for download. We are looking for the Download link marked Recommended for 5.x.

  2. Download the module from the Views project web page. Here is one way to do that:

    • Right-click in Firefox on Download.

    • Select Copy Link Location (in Internet Explorer, this link will be called Copy Shortcut). You now have text similar to the following in your clipboard:

      A file with the .tar.gz extension is affectionately known as a "tarball", reflecting the days when files were backed up onto tape archives.

    • Switch to your Drupal server window. Be sure you are still in your <DRUPALROOT>/sites/all/modules directory.

    • Type:

      wget <Paste><Enter>


      In many shell environments, you can use the right mouse button to paste text from the clipboard. In Windows, you can use Ctrl+V.

    • The result on your screen, after pasting the download link, will be:


    After pressing Enter, the download begins. You are provided with a status report of the percent complete as shown in the following screenshot:

  3. Uncompress the module to the <DRUPALROOT>/sites/all/modules/views directory. Enter:

    tar xvf views-5.x-1.5.tar.gz

    Depending on your system setup, you may need syntax such as this:

    tar -zxvf views-5.x-1.5.tar.gz

    You may also use an alternative uncompression tool, such as 7-Zip or WinRAR. WinRAR offers a graphical interface in Windows, but is also available with a command line interface for Mac and Linux systems. The output of the tar xvf views-5.x-1.5.tar.gz command is seen in the following screenshot:

Enabling the module

  1. Return to your browser window. Go to the Module page at:

    If you are not already logged into your Drupal site as an administrator, you will need to do so. Scroll down to the Views fieldset and enable the Views and the Views UI modules by clicking the two associated checkboxes.

  2. Click on the Save configuration button.

    Congratulations! You will now see a message (similar to the screenshot that follows), signaling the successful installation of our module.

Recipe notes

UI is an abbreviation for "User Interface". The Views UI module offers a point-and-click approach for selecting content and output types, controlling view sort order, and so on. The Views UI can even generate a views programming code for you, as we'll see in Chapter 2. If the Views UI module were not enabled, you could still see the existing views and create new views through code. However, the Views UI module is quite helpful: even "Ninja" Drupal programmers will typically enable it.

Command line tips

These shortcuts will assist you in your Drupal development (your host environment may, or may not, have all of these shortcuts enabled).

  • Press Ctrl+U in the command line to clear everything to the left of the cursor. For instance, if you paste something, and then realize the wrong text was in the clipboard, it may be easier to clear the whole line than to press backspace many times.

  • Press Ctrl+K on the command line to clear everything to the right of the cursor.

  • Press the up arrow to re-use a previous command line. You may also search your command history with Ctrl+R.

  • Type !$ on the command line to reuse the last argument of the previous command line. For example:

    more views_ui.module views.module

    lets you page through the text of both modules. The last argument of that command was views.module. If your next command is:

    less !$

    this will print as:

    less views.module

    (This tip is difficult to find with a search engine. A Google search for !$ yields nothing.) Quit both the more and less commands by typing:

  • Use "man" pages. Man is shorthand for the manual.

    man less

    reveals that

    Less is a program similar to more but which allows backward movement in the file as well as forward movement.

  • Type cd to go to your home directory.

    To return to the previous directory you were in, type:

    cd -
  • If you are not sure where you are in your directory structure, type:


    This is the "print working directory" command, which provides the full path to your current directory. This is especially useful if your prompt is not set up to already display the full path.

  • Use the Tab key for command line completion. In step 6 of the recipe above, you could type:

    tar xvf v<tab>

    If there is only one file that begins with v in the directory, the Tab key will conveniently complete the full name of the zipped .tar file:

    tar xvf views-5.x-1.5.tar.gz

    Press Enter to run the command.

    If you already had the votingapi module installed, for instance, you would need to enter:

    tar xvf vo<tab>

    to distinguish voting from views.

Recipe 2: Views-related URLs on your site



Administrative access to a Drupal web site and a printer

This is a quick tour of Views-related URLs on your site. Make yourself at home. Feel free to click around and generally become familiar with the Views interface.

  1. Administer Views:

  2. Add a View:

    (This is where we'll be spending much of our time in this book.)

  3. Import a View:

  4. Views Tools:

  5. Views Help:

  6. Views UI Help:

    (While you are on this page, go ahead and print it. This is an easy page to miss, but quite informative.)

  7. Views Permissions:

    (We will interact with this page in Recipe 7.)

  8. Enable Views modules:

Recipe notes

  • If your site does not have the Clean URLs option Enabled, you will need to add ?q= before the URL parameters in the URL. For instance:


Recipe 3: Creating a "Swim Groups" Page View



Administrative access to a Drupal website

You may think of the Views UI as a series of questions. Here are some sample questions to consider:

  • What do I want to name this view?

  • What do I want to display?

  • Who should be able to view this content?

  • In what format should the content appear?

  • Do I want the content to appear in a page, or in a block (or both)?

  • How many items to display?

  • Is there any particular order (By date? Alphabetically?)

We will first need to create the content for our view.

Creating a new Content type (Swim Group), and adding content

  1. Go to Administer | Content management | Content Types. Select Add content type (

    If you have the Content Construction Kit (CCK) module installed, you will see more than two tab options, but as seen in the following screenshot, we simply have the Drupal 5 core, plus the Views modules that we have installed.

  2. Enter Name, Type, and Description.

  3. Keep the Submission form fieldset at default settings.

  4. In the Workflow fieldset, uncheck Promoted to front page and set the Default comment setting to Disabled.

  5. Save your new content type. You will see a list of your Content types, and a message that your new content type has been added.

  6. Go to Create Content | Swim Group, and add at least three content items (

Creating a View

  1. Go to Administer | Site Building | Views (, and select Add.

  2. In the Basic Information fieldset, enter the following:

    • Name: swim_group

    • Description: List of swim groups

  3. Sections of the main Views UI form are contained in HTML fieldsets. Click on Page to open that fieldset if it is not already expanded. Note that when a fieldset is closed, a triangle icon points to the fieldset name (as seen in the following image); when the fieldset is expanded, the triangle icon points down. This is a subtle clue (available in most themes) to help you navigate the page.

  4. Enter the following values in their respective fields:

    • Provide Page View
    • URL: swim-groups

    • View Type: Full Nodes

    • Title: Swim Groups

    • Use Pager
    • Nodes per Page : 20

    In this section, we are essentially creating a new URL on the site, and displaying full content items (nodes). We are specifying that up to 20 items will be displayed on the page, and if we have more, we will have the option to see additional items on subsequent pages.

Selecting Filters

The following figure offers a visual representation of Views filtering. We see the multiple content types available on the site symbolized on the left (for instance, Page, Story, Swim Group). The filter allows only one content type to be displayed. In our case, we just want the Swim Group.

  1. Open the Filters fieldset. If you printed the Views UI Help, as suggested in Recipe 2, now is a good time to review the Filters options. There are many filter options available. We will select just two from the Add Filter drop-down list, Node: Type, and Node: Published. These are by far the two most commonly used filters. Select Node: Type from the drop-down, and click on Add Filter.

    The filter is added "above" the drop-down list.

    Select the Value as Swim Group and leave the Is One Of option of Operator, as shown in the following screenshot:

  2. Return to the Add Filter dropdown, and add the Node: Published filter. (As you add filters in Views, you may find that the interface hops back to the top of the page. If this happens, dutifully scroll back down to the Filters fieldset.) By default, when you add this filter, Node: Published Equals Yes. Leave the default as-is.


    If this filter is not added, the view will display items that are marked unpublished. This is an easy filter to forget, but it is recommended.

  3. You will now see a variety of Ops buttons. Note the Delete button. With a little imagination, you can see it looks like a trash can. Also, if you move the mouse over the button, the popup text, Delete this item appears. The delete button does not delete content from the site, it simply removes the filter. For instance, if you delete the Node: Published filter, the view would contain both published and unpublished content. The up and down buttons will prove most useful in the Sort and Field fieldsets, which we cover in Chapter 2. In Chapter 4, we will also cover exposed filters.
  4. Click on Save. When you first create a view, you are brought back to the "Views" List page. If you Edit your view from the view itself, you will be brought back to the view itself after editing it. Notice that the full URL of your view is The message, View successfully saved, appears only the first time you view this. As an administrator, you will also see the Edit, Clone, and Export tabs. Those tabs are not displayed to site users who do not have Views administrative rights.

Recipe notes

It is worth highlighting some subtle distinctions in naming conventions.

  • Name: This is the unique identifier for a view. Hyphens are not allowed: use an underscore to separate multiple words.

    Compare the Name fields for adding content and adding a view. When creating a content type in Drupal 5 (Step 2, above), the first item on the page is the human-readable Name, while the machine-readable type appears second. The Views interface (Step 8) breaks this convention; the first item on the page is the machine-readable Name.


    Machine-readable: swim_groups

    Human-readable: Swim Groups

    It is not a big problem if you misname a view (by including spaces, for instance). All of your careful settings will remain intact, and Drupal will simply issue the message: View name must be alphanumeric or underscores only, when you attempt to save your view. Edit the Name, and scroll back down to the bottom of the page to Save the Views form again. You are not required to use lower case in your Views Name, but it is a common and oft-preferred practice.

    It is acceptable for a machine-readable view name to be the same as the machine-readable content type. More typically, however, the content type will be singular, and the Views name plural. In our case, the content type is swim_group, and the view name is swim_groups.

  • URL: If you would like to use more than one word in a URL, use hyphens to separate them. This enables Google (and possibly to other search engines as well) to index them as separate words. Many developers use underscores, but hyphens have the edge when it comes to search engine optimization.


    View Name: swim_groups

    View URL: swim-groups

    You may include slashes in the URL field. For instance: groups/swim.

  • Title: The title displays at the top of each page in the view. You may use some HTML markup such as <em>, <i>, and <b> to highlight phrases in the title. You may use a line break in a title <br />. You may also use HTML entities, such as &rarr; A helpful list of entity codes can be found at: For the most part, however, formatting of the full title is handled in your theme (thus, you will not specify fonts or other styles on the Views page).


    <em>Swim</em> Groups

    Swim Groups: <br />Tadpoles, and Guppies, and Wrigglers, Oh My!

    Voil&agrave: Learn to swim at any age

    Compare Views Titles with Node Titles. HTML markup is allowed in View Titles, but not in Node Titles.

Recipe 4: Adding a Header to your View



Completed Recipe 3

You can easily add custom text or graphics above or below your view content, using the Header and Footer fieldsets. We will add a brief description at the top of the Swim Groups page.

  1. Go to Your swim_groups view is now included in the list of views.

  2. Click on swim-groups in the URL column.

  3. Open the Page fieldset, and then open the Header fieldset contained within it.

    Enter the following header text:

    Swimming is a great sport which exercises the whole body. Swim lessons are available for all ages and ability levels. Note: A parent or guardian must accompany children under 5 when in the water.

  4. Open the Input format fieldset contained within the Header fieldset. Note that Filtered HTML is selected. See the Recipe notes if you would like to expand the list of available HTML tags.

  5. Scroll down to the bottom of the Edit view page, and click on Save.

  6. Enjoy the view.

Recipe notes

  • The Header fieldset (along with the Footer and Empty Text fieldsets) each contain Input format fieldsets. Input format filters will modify the display of text that has been entered by users (Input format filters are not connected to the filters fieldset that we described in Recipe 3). When a user enters text or code into a Drupal site, the text is saved in the database exactly as typed. Next time we view the text, however, it may not look exactly the same—some text and tags may not appear. To modify the list of allowed tags, visit the Site Configuration | Input Formats page, at:

  • The most common reason for using these filters is to protect your site from malicious users, or even from users who don't intend to be malicious but who exhibit bad form. The Input format ensures that scripts will not be run, and that badly formed HTML will not break your site's layout. Filtered HTML is the name of one of the default Input formats.

  • A terrific article by Robert Douglass offers helpful information on input filters at:

Recipe 5: Adding a View to a Menu



Completed Recipe 3 or 4

  1. Edit the Swim Groups view, at:

  2. Open the Menu fieldset, found within the Page fieldset. Check the Provide Menu option, and add a Menu Title.

  3. By default, the menu item appears in the Navigation menu. We don't want it here so we will move it in the next step.

  4. Go to Administer | Site Building | Menus.


  5. Use your browser to do a Find (usually Ctrl+F) for the word Swim. The first result will likely be in the actual sidebar menu item (if the Navigation menu has been placed in a region on the page). The second find will be the Swim Group content type listing in the menu configuration. The third one, finally, is the menu listing for the Swim Groups view. Click on the Edit link.

  6. The Path is already filled in, based on our settings from the Views UI (Step 2). Enter a Title, and change the Parent item to Primary Links. If you wish the menu items to appear in alphabetical order, you may leave the Weight for all items at 0. In our example, we'll set the weight to a negative number, ensuring that it appears early among the primary links.

  7. Your view is added to your Primary Links menu.

Recipe notes

Newly created swim groups are automatically added to the Swim Groups view, and its associated menu item.

Recipe 6: Creating a Block of Swim Groups



Completed Recipe 3 or 4

In Recipe 3 , we created a page view, which is accessed via a URL. In this recipe, we are going to edit that view, adding a Block based on the same content. A view may provide both a Block and a Page view at the same time.

Blocks are placed inside regions made available by your theme. Sample regions that are common across most themes include the left sidebar, right sidebar, content top, and content bottom. A given block can appear on every page of the site, or just on pages that you designate. In the following steps you will create a Block for the Swim Groups view.

  1. Go to Administer | Site Building | Views

  2. Select the Edit link next to the swim_groups view.

  3. Open the Block fieldset, if it is not already open, and enter the following:

    • Provide Block
    • View Type: List View

    • Title: Swim Groups

    • Nodes per block: 10

    • [More] Link?
  4. Open the Fields fieldset, and add the Node:Title field. You may leave the various options at their default settings.

  5. Go to the Blocks page via Administer | Site Building | Blocks:

    Place the swim_groups block in the right sidebar (see the image below). Click on the Save blocks button at the bottom of the page.

  6. View your Block on any page of the site. The Block configuration page itself provides special formatting to inform administrators about various regions, so you may wish to view your block from a different page. For instance, click on the site logo, to go to the home page.

Recipe notes

It can sometimes be a bit disconcerting to have a single view create both a block and a page. The appearance may be different enough to be surprising. For instance, in our case, the block view contains a simple list of linked titles, while the page view contains the full text. The block had a maximum of 10 per page, while the page had a maximum of 20. You may optionally create separate views for blocks and pages. Consider naming the respective views block_swim_group, and page_swim_group, for instance. (Use separate views when filters, fields, or sort order differs between the page view and the block view. Otherwise, it's more maintainable to use one view for both blocks and pages.) Note that the Administer Views list keeps track for you, signaling that the swim_groups view has provided a Page, a Block, and a Menu item.

Recipe 7: Creating an "Admin" Role and setting Access Permissions



Admin Role module:

When you first installed Drupal, the first user you created was, naturally, user #1, also known as the "super-administrator". If others users need administrative access to the site (to administer Views, for instance), it is a good practice to create a distinct admin role. The Admin Role module will save you the trouble of having to manually set permissions each time you install a new module. All new permissions will automatically be enabled for the admin role.

Installing the Admin Role module

  1. Go to

  2. Download the Drupal 5 Admin Role module to:


    (Select the "tarball" marked Recommended for Drupal 5.)

  3. Unzip the module.

  4. In your browser, go to the Modules page at Administer | Site Building | Modules ( Scroll down to the Other fieldset, and enable the Admin Role module.

Adding an Admin Role

  1. Go to the Roles page at Administer | User Management | Roles ( and add an admin role.

Configuring the Admin Role module

  1. Go to the User management | Admin Role page at ( and select your newly created admin role from the drop-down list.

  2. Go to the User Management | Access Control page, and note that the admin(first column) already has the permissions set. These permissions were enabled by the Admin Role module.

Creating a User for the Admin Role

  1. Go to Administer | User Management | Users and select Add user.

  2. On the User account page for your new user, add a Username, E-mail address, and Password, and be sure to check the admin role.

Recipe notes

You will receive an Admin Permissions Set message at the top of the module page each time you enable a new module (some modules do not actually create new permissions, but you will receive this status message, nevertheless).

Recipe 8: Installing Firefox and Firebug

The rest of the recipes in this chapter are devoted to enabling you to see the full scope of the Views interface. This recipe is a prerequisite for Recipe 9, Revealing the full extent of Views. Firefox and Firebug are also useful in any web developer's toolkit.

Installing Firefox

Bring up your current browser, and go to Click on the Free Download button. Follow the detailed directions for installing Firefox here:

Installing Firebug

  1. From Firefox, you can install Firebug by visiting Tools | Add-ons.

    You may also download the Firebug add-on from:, or

  2. Go to the Get Add-ons tab, and click on Browse All Add-ons.

    This will bring you to the Firefox Add-ons page.

  3. Enter firebug in the search box. When the add-on description is returned, click on Add to Firefox.

  4. Click on Install Now.

  5. Restart Firefox to make the Firebug add-on available to the browser.

  6. Note the new Firebug icon at the bottom-right corner of your browser. Congratulations! You now have Firebug installed.

Recipe notes

Firefox Add-ons are also called "extensions". Many web developers say that if they could only install one Firefox extension, it would be Firebug. Consider spending some time at to learn more about its features. For more in-depth discussion, join the Firebug discussion group at

Recipe 9: Revealing the full extent of Views



Completed Recipe 8

One reason that Views can feel a little bit mysterious, is that so much of it is concealed at first.

This recipe exposes all of the options on the main View's Edit screen by expanding all of the collapsed fieldsets on the page. This will save you the time it would take to manually open the nearly two-dozen fieldsets. The recipe uses a single line of jQuery. Please do not feel that you have to understand everything all at once when you see the full extent of Views! That's what the rest of this book is for. There is value, however, in the full array of options that will be available to you. A summary of the full screen can be found in Recipe 7. Note that fieldsets are nested within other fieldsets, up to three levels deep.

The list of all the fieldsets in the View's Edit screen is as follows:

  • Basic Information

  • Page

    • Header

      Input format

    • Footer

      Input Format

    • Empty Text

      Input format

    • Menu

      Default Menu Tab

  • Block

    • Header

      Input format

    • Footer

      Input format

    • Empty Text

      Input format

  • Fields

  • Arguments

    • Argument Handling Code

  • Filters

  • Exposed Filters

  • Sort Criteria

Ensure that Firefox and Firebug are installed (See Recipe 8)

  1. Go to admin/build/views/swim_groups/edit. If you have not yet created a view, go to admin/build/views, and click on Add.

  2. Click on the firebug icon in the Firefox status bar, or press F12 (on Apple laptops, it may be necessary to hold down "Fn" while pressing F12). If you get a message regarding the need to enable Firebug for the site, go ahead and do that. Firebug opens at the bottom of the browser.
  3. Click on the Console tab in Firebug. An understated JavaScript (and jQuery) command line appears in the lower left, after the >>> prompt. You may notice the blinking cursor.

Running the jQuery command

  1. In the command line area, enter the following jQuery command. Make sure to include the dollar sign character.


  2. The full scope of the views Add or Edit interface appears in the browser. Take some time to explore the page.

Recipe notes

How does this recipe work? If the jQuery command above were to be read as English, it would say: "Find all of the fieldsets on the page, and remove the collapsed CSS class from all of them". The effect is to open all the fieldsets (JavaScript must be enabled for this to work).

Let's elucidate this further:

  • The HTML fieldset tag in most Drupal themes (including the default Garland theme) looks like this, when collapsed: <fieldset class="collapsible collapsed">

  • An expanded tag looks like this in HTML:

    <fieldset class="collapsible">

The jQuery code removes all of the "collapsed" classes from the Views page. Thus, all the fieldsets are open, revealing their full contents.

Most of the time, you will not want to interact with Views in this expanded way, but it certainly is helpful, sometimes. It's nice to know that Firebug CSS edits are temporary. The next time you view the page, the fieldsets will refresh with their default open or closed appearance. Press F5 in Firefox to refresh the page you are on.


This jQuery fieldset expansion command does not function if you have already manually closed a fieldset with your mouse.

Recipe 10: Preparing Views Worksheets



The Views Worksheet in this chapter

Copy machine

Pen or highlight markers

On the following page is worksheet that lists each element on the View's Add or Edit form. This worksheet will serve as your guide as you learn the features of Views.

  1. You have permission to photocopy the Views Worksheet. Start with a dozen copies or so. You may choose to copy more or less depending on whether you think this resource suits your learning style.

  2. Edit the Swim Groups view that you created in Recipe 3

  3. On a worksheet copy, mark each element used by the view (use a pen, or highlight markers according to your preference).

Recipe notes

The worksheet divides elements into four categories: Text, Checkboxes, Dropdowns, and Radio Buttons.

  • Some text boxes expect numeric characters, as noted in parentheses.

  • Checkboxes can be considered as a yes or no question. For instance: Provide Page View is the Views shorthand for "Do you want to provide a page view?"

  • Some of the drop-down boxes allow you to select more than one element.

  • Radio buttons are mutually exclusive.


In Chapter 1, we installed Views, took a whirlwind tour of associated URLs, and then created our first view: a list of Swim Groups. We edited the page view to add header text and then created a menu link. We then produced a block that could be added to any page. We had a chance to see the full scope of the Views interface in two ways: first, using a jQuery command to expand all fieldsets, and second, using a summary worksheet of all the Views Edit options. Worksheet copies will continue to be a useful resource throughout the rest of the book.

Left arrow icon Right arrow icon

Key benefits

  • Display particular types of content in unique and compelling ways on your Drupal web site
  • Enhance your web site with calendars, timelines, galleries, maps, podcasts, Views Fusion, and more
  • Indispensable resources for Drupal 5 Administrators ñ Drupal Administration Menu, Views Bulk Operations, ModuleInfo, and Editable Fields modules
  • More than 90 recipes ñ pick the ones that work best for your web site


The Drupal View modules give you flexibility and freedom to customize the display of your web site's content. Although there are more than 100 views-enabled modules, few site administrators use Drupal Views to its full potential. This book will enable you to realize the fullest potential of this powerful resource by providing a wide variety of powerful recipes for creating and displaying a wide variety of views ñ essential classics you will use again and again to innovative display methods that will make your Drupal site stand out. Pick and choose the ones you would like to prepare for your web site. In this book you will find ninety-four recipes to create a wide selection of views. The list includes event listings, interactive calendars and timelines, maps, proximity search, podcasting, carousels, Views Fusion, and many more. You will also explore default views, views with CCK, and master a variety of ways to associate views with related content. Most people think of Views for site visitors. But Views can also be handy for site administrators. You will get to know the Views Bulk Operations module, along with Editable Fields, and Views Custom Fields. (You'll probably wonder why you never used them before!) If you want to take Views to the next level, the book contains a code-rich chapter on theming. However, you will find most of the recipes detailed by the author do not require any original coding at all. As you progress through the recipes, you will be immersed in such Drupal Views topics as fields, arguments, filters, exposed filters, sorting, style plug-ins, formatters, cloning and copying views. Because Drupal is a worldwide and ever adapting system, the author also includes great tips and resources for navigating the online Drupal community and expanding your knowledge of the recipes. Finally, there is an extensive Appendix, which includes listings of all default views, formatters and style plug-ins for Drupal 5, along with a categorized list of patches.

What you will learn

Master the Views User Interface Create views arguments Implement and create default views for recent comments, the frontpage, group listings, and more Explore a variety of ways to associate views with related content Display event listings, calendars, and timelines Make site administration easier using several administration modules Enhance your web site with Google Map tools, YouTube video bar, photo gallery, audio, and Views Fast Search Enable your users to flag and bookmark content for later viewing Incorporate views into panels and tabs Create a directory of available theme functions, and learn some key debugging strategies Use theme overrides and CSS to create more attractive views Fix the long-standing taxonomy term bug, and the body field Views display issue Create and apply patches Create some helpful browser buttons and search plug-ins to facilitate finding information online

Product Details

Country selected

Publication date : May 27, 2009
Length 412 pages
Edition : 1st Edition
Language : English
ISBN-13 : 9781847196965
Category :
Concepts :

What do you get with eBook?

Product feature icon Instant access to your Digital eBook purchase
Product feature icon Download this book in EPUB and PDF formats
Product feature icon Access this title in our online reader with advanced features
Product feature icon DRM FREE - Read whenever, wherever and however you want
Buy Now

Product Details

Publication date : May 27, 2009
Length 412 pages
Edition : 1st Edition
Language : English
ISBN-13 : 9781847196965
Category :
Concepts :

Table of Contents

22 Chapters
Drupal 5 Views Recipes Chevron down icon Chevron up icon
Credits Chevron down icon Chevron up icon
About the Author Chevron down icon Chevron up icon
Acknowledgement Chevron down icon Chevron up icon
About the Reviewer Chevron down icon Chevron up icon
Preface Chevron down icon Chevron up icon
1. Introduction to Views Chevron down icon Chevron up icon
2. Working with Default Views Chevron down icon Chevron up icon
3. CCK and Views Chevron down icon Chevron up icon
4. Dates and Calendars Chevron down icon Chevron up icon
5. Views and Tools for Administrators Chevron down icon Chevron up icon
6. Views Galore Chevron down icon Chevron up icon
7. Theming and Layout Chevron down icon Chevron up icon
8. Navigating the Online Drupal Community Chevron down icon Chevron up icon
Default Views in Drupal 5 Modules Chevron down icon Chevron up icon
Formatters Chevron down icon Chevron up icon
Style Plugins Chevron down icon Chevron up icon
Views Hooks for Coders Chevron down icon Chevron up icon
Modules Included in Recipe Ingredients Chevron down icon Chevron up icon
Additional Resources and Modules Mentioned in Recipes Chevron down icon Chevron up icon
Selected Noteworthy Patches to Views Chevron down icon Chevron up icon
Index Chevron down icon Chevron up icon

Customer reviews

Top Reviews
Rating distribution
Empty star icon Empty star icon Empty star icon Empty star icon Empty star icon 0
(0 Ratings)
5 star 0%
4 star 0%
3 star 0%
2 star 0%
1 star 0%
Filter icon Filter
Top Reviews

Filter reviews by

No reviews found
Get free access to Packt library with over 7500+ books and video courses for 7 days!
Start Free Trial


How do I buy and download an eBook? Chevron down icon Chevron up icon

Where there is an eBook version of a title available, you can buy it from the book details for that title. Add either the standalone eBook or the eBook and print book bundle to your shopping cart. Your eBook will show in your cart as a product on its own. After completing checkout and payment in the normal way, you will receive your receipt on the screen containing a link to a personalised PDF download file. This link will remain active for 30 days. You can download backup copies of the file by logging in to your account at any time.

If you already have Adobe reader installed, then clicking on the link will download and open the PDF file directly. If you don't, then save the PDF file on your machine and download the Reader to view it.

Please Note: Packt eBooks are non-returnable and non-refundable.

Packt eBook and Licensing When you buy an eBook from Packt Publishing, completing your purchase means you accept the terms of our licence agreement. Please read the full text of the agreement. In it we have tried to balance the need for the ebook to be usable for you the reader with our needs to protect the rights of us as Publishers and of our authors. In summary, the agreement says:

  • You may make copies of your eBook for your own use onto any machine
  • You may not pass copies of the eBook on to anyone else
How can I make a purchase on your website? Chevron down icon Chevron up icon

If you want to purchase a video course, eBook or Bundle (Print+eBook) please follow below steps:

  1. Register on our website using your email address and the password.
  2. Search for the title by name or ISBN using the search option.
  3. Select the title you want to purchase.
  4. Choose the format you wish to purchase the title in; if you order the Print Book, you get a free eBook copy of the same title. 
  5. Proceed with the checkout process (payment to be made using Credit Card, Debit Cart, or PayPal)
Where can I access support around an eBook? Chevron down icon Chevron up icon
  • If you experience a problem with using or installing Adobe Reader, the contact Adobe directly.
  • To view the errata for the book, see and view the pages for the title you have.
  • To view your account details or to download a new copy of the book go to
  • To contact us directly if a problem is not resolved, use
What eBook formats do Packt support? Chevron down icon Chevron up icon

Our eBooks are currently available in a variety of formats such as PDF and ePubs. In the future, this may well change with trends and development in technology, but please note that our PDFs are not Adobe eBook Reader format, which has greater restrictions on security.

You will need to use Adobe Reader v9 or later in order to read Packt's PDF eBooks.

What are the benefits of eBooks? Chevron down icon Chevron up icon
  • You can get the information you need immediately
  • You can easily take them with you on a laptop
  • You can download them an unlimited number of times
  • You can print them out
  • They are copy-paste enabled
  • They are searchable
  • There is no password protection
  • They are lower price than print
  • They save resources and space
What is an eBook? Chevron down icon Chevron up icon

Packt eBooks are a complete electronic version of the print edition, available in PDF and ePub formats. Every piece of content down to the page numbering is the same. Because we save the costs of printing and shipping the book to you, we are able to offer eBooks at a lower cost than print editions.

When you have purchased an eBook, simply login to your account and click on the link in Your Download Area. We recommend you saving the file to your hard drive before opening it.

For optimal viewing of our eBooks, we recommend you download and install the free Adobe Reader version 9.