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
7
votes
1 answer

How to mass delete content and file nodes with filters

What is a good drupal-friendly way to mass delete thousands of nodes and files with selective filters? I need this functionality to supplement my drush mass import script.
bdombro
  • 1,251
  • 11
  • 17
7
votes
3 answers

Drupal Add Static link to a view

I have a Drupal view that lists a node called publication. At the top of the page I'd like to have a link 'new publication' instead of having it in the navigation block. Can somebody direct me on how to go about this? There seems to be several…
slotishtype
  • 2,715
  • 7
  • 32
  • 47
7
votes
2 answers

Inline add/edit/delete data in views in Drupal 7

I am trying to create a content type (say Meter). Each Meter consists of a "Meter Reading". This meter reading content contains three fields, say title, date range and usage. I have a Panel page where I display all the Meter Readings related to a…
Shekhar Chikara
  • 3,786
  • 2
  • 29
  • 52
6
votes
1 answer

Drupal 7 views filter by node's taxonomy term

I have a similar question to my previous one (Drupal 7 views filter by dynamic taxonomy term), it's only the other way round. I have a "partner" content type, each with it's own taxonomy term. The other content type is a regular page with multiple…
mreq
  • 6,414
  • 4
  • 37
  • 57
6
votes
2 answers

Adding a custom filter to views in Drupal 7

im using Drupal 7 and I want to add a new filter in views. I have a custom table "clicks" with two fields; nid and clicks_left. The filter should just contain a checkbox "Only display nodes with clicks left". So the filter should join node and…
Per
  • 61
  • 1
  • 1
  • 2
6
votes
2 answers

How to publish data residing in an external database using Drupal?

I'm very new to Drupal and was getting a bit of mixed information about views so I wanted to see if anyone can set me on the right path. Here's my situation. I have a separate database (on the same Drupal database server), that has a lot of data…
Lostsoul
  • 25,013
  • 48
  • 144
  • 239
6
votes
2 answers

Drupal - How can I make an array globally accessible?

I'm using this code in a views field template (in this case views-view-field--all-members--uid.tpl.php): uid); $users_friends_ids = array(); foreach ($users_friends as $id => $value) { …
james6848
  • 1,657
  • 3
  • 25
  • 39
6
votes
7 answers

Drupal : how to sort and display nodes grouping by first letter in view

I have a huge list of companies (nodetype : company, only field is title) that I want to display in a nice way groupping them by first letter like a dictionnary like this : A Abc company Alot of work company B Beautiful company Best…
Disco
  • 4,226
  • 11
  • 58
  • 76
6
votes
5 answers

How can I add a summary row to a Drupal View?

I've built a view (Drupal 6.x, Views 2.x). I'd like to be able to add a summary row at the end of this view — total up several columns and include the totals in the summary row. How can I do this? Is there some Views data-altering hook I can…
smokris
  • 11,740
  • 2
  • 39
  • 59
6
votes
0 answers

Translating Views Exposed filters Label

I'm trying to translate the views exposed filters labels on my site. i manage to have the exposed filters themselves translated with the Internationalization Views module. I tried the string override module to translate the exposed filters labels…
user331205
  • 61
  • 2
6
votes
6 answers

Drupal - Getting node id from view to customise link in block

How can I build a block in Drupal which is able to show the node ID of the view page the block is currently sitting on? I'm using views to build a large chunk of my site, but I need to be able to make "intelligent" blocks in PHP mode which will have…
MrFidge
  • 2,107
  • 11
  • 40
  • 63
6
votes
2 answers

Drupal Views Has Taxonomy Term with multiple terms

Good Morning, I am developing an website and i am in a struggle to resolve this: I have a link like this: mywebsite.com/aliments/fruit/banana. And in a View that creates the page aliments i want only to show terms with fruit and banana checked at…
6
votes
1 answer

Drupal 7 preprocess_views not working

I have the following code in my Drupal 7 template.php file: function mytheme_preprocess_views_view__videos__videos(&$vars) { drupal_add_css(drupal_get_path('theme', 'mytheme') . "/css/qwembed-jquery-1.0.css"); …
Cybercampbell
  • 2,486
  • 11
  • 48
  • 75
5
votes
2 answers

Drupal 7 views_embed_view and templates

In Drupal 7 created a block view (called *super_gallery*) of grid format added a template specialization views-view-grid--super-gallery--block.tpl.php cleared theme registry cleared all caches Using preview in view editor I can see output modified…
Alessandro Pezzato
  • 8,603
  • 5
  • 45
  • 63
5
votes
3 answers

Add Table Join, Where, and Order By to Views Query in views_query_alter()

I am trying to modify the query for Views in Drupal (Views version 3, Drupal version 7). What I want to do is change the query prior to running such that it LEFT JOINs a table in which I have weights assigned to the nodes. If I was to write the…
user830694
  • 63
  • 1
  • 1
  • 5