Questions tagged [drupal-views]

The Views module is a Drupal module that allows creating lists of content with a flexible query builder.

The Views module, written by Earl (MerlinofChaos) and Lynette Miles, is a Drupal module that allows creating lists of content (e.g. pages, RSS feeds, and blocks) with a flexible query builder. It is one of the most popular Drupal modules. Views 2.x is quite mature, Views 3.x is much newer but also more powerful.

Drupal manages content by storing it in a relational database and content can be retrieved by making queries to the database. Views provides a user interface (UI) for defining complex queries giving site developers the ability to select specific content without writing code. The module can be selected from the admin/structure/views menu option.

The Views UI

There are two primary form pages used to command the views module, the Views Management form and the Views Definition form. The Management form is the first page seen when selecting Views and displays all available View definitions along with some basic information about each. It includes options to enable or disable the View definition. By selecting a View definition's edit button, the user actual definition page is displayed. This page includes all the options available for settings to provide a specific view.

View Definitions

Basics

The options available for defining a view are extensive and it is recommended that the user spend some time reviewing its capabilities using the resources listed in this Wiki. Generally, when beginning a new definition, you define the basic parameters you want for the view including the type of display (page or block) the type of entity (node, user, taxonomy), the information you want displayed (full content, fields, feeds, images, etc), how you want to filter the content and the order for sorting it. This basic information is stored in a hidden master (it can be exposed through View Settings)and serves as the default for the definition. In addition to this initial view, you can create variations by adding other pages or blocks to the definition.

Resources

Screencasts

  • Taming the Beast from nodeone.se
    This extensive video series by Johan Falk covers nearly every key feature of the module.

Books

  • Drupal Building Blocks - Addison Wesley Publishing, by Earl and Lynette Miles
    This book covers using the CCK Content Construction Tools, Views, and Panels to and display sophisticated content using these modules in concert.
1822 questions
11
votes
4 answers

OR operator in Drupal View Filters

I need to implement an OR operator between some filters in a Drupal View. By default, Drupal AND's every filter together. By using hook_views_query_alter(&$view, &$query) I can access the query ( var $query ) , and I can change either…
Vodde
  • 375
  • 1
  • 2
  • 8
10
votes
2 answers

Filter a Drupal view (displayed in a panel) by taxonomy term depending on domain

This is a Views 6.x-2.x problem: On a site with many different views (many of which are blocks included in Panels that pass arguments to blocks) I would like to filter views by a taxonomy term depending on the domain the site is visited through.…
yotka
  • 1,002
  • 2
  • 11
  • 19
10
votes
5 answers

drupal > views > exposed filter > submit on change

I've got a view with a single exposed filter (a select). It's using ajax to re-populate when the user clicks "Apply". I'd like them not to have to click that and just re-populate when the select is changed. I'm assuming I'm going to need some JS…
sprugman
  • 19,351
  • 35
  • 110
  • 163
9
votes
3 answers

Fundamental understanding of how Views and Pathauto work together

I am having fundamental problems understanding when to use a pathauto rule, and when to use a views page path. I have several custom content types, and I am using blocks to display certain parts of nodes on certain paths. Then I use a views page to…
Dan Johnston
  • 131
  • 1
  • 4
9
votes
7 answers

How to display the query executed by the Drupal view

I want to display the query that is executed in the drupal view. Currently in the view editor it shows the query however I have a need to use that query in my code to download an excel version of the view. Is there a way to get the executed query…
Mech
  • 2,904
  • 3
  • 24
  • 29
9
votes
4 answers

print_r to get object methods in PHP?

I'm working with Views 2 in Drupal 6, and I am having difficulty finding documentation on the methods of the View object. Is there any PHP function like print_r that outputs methods as well as fields?
Nick Heiner
  • 119,074
  • 188
  • 476
  • 699
8
votes
3 answers

Exposed filters not displayed in Drupal 7 - Views 7.x-3.0-rc1

in Drupal 7, using views 7.x-3.0-rc1 I can't see my exposed filters, they don't appear in any views type (block, page, attachement). I'm new to Drupal 7 but have been using Drupal 6 for quite some time. is there something new with filters? is it a…
Mathias Olive
  • 81
  • 1
  • 3
8
votes
4 answers

How to display only taxonomy terms with nodes associated to in Views 2?

I've created a view with a set filters exposed (to show filtering options in the page). And one of those filters is a select field with all the taxonomy terms of a vocabulary. That's ok, it's showing now. But I want to only show the taxonomy terms…
Leandro Ardissone
  • 3,009
  • 6
  • 32
  • 31
7
votes
2 answers

Drupal 7 Views 3 glossary mode: where is it?

I have searched all over and I'm having trouble with the Views 3 UI. I can't find where to turn on the glossary mode in the view settings for an attachment. I apologize if this is a dumb question, but I see it in the screen shot for the answer to…
Sarah
  • 71
  • 1
  • 1
  • 2
7
votes
3 answers

limit drupal view to show only nodes created by user

I'm using drupal 7. I created a view for displaying nodes of a specific content type (e.g. products). When viewing the page, I want only those products displayed which were created by the user (currently shows all products). I would like to do it…
siiva33
  • 123
  • 1
  • 1
  • 8
7
votes
5 answers

Drupal Views: Generate xml file

Is there a views plugin that I can use to generate a xml file? I would like something that I could choose the fields I would like to be in the xml and how they would appear (as a tag or a attribute of the parent tag). For example: I have a content…
Luiz Guilherme
  • 1,601
  • 21
  • 37
7
votes
3 answers

Views is stripping tags from the output

I have a Drupal view which should output a video player using flash. I am trying to output a script that will call the flash film. The problem is that Views applies some sort of filter that strips my