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.
1792 questions
85
votes
10 answers

How to quickly theme a view?

I've defined a view with the CCK and View 2 modules. I would like to quickly define a template specific to this view. Is there any tutorial or information on this? What are the files I need to modify? Here are my findings: (Edited) In fact, there…
Pierre-Jean Coudert
  • 8,873
  • 10
  • 46
  • 59
38
votes
17 answers

displaying a Drupal view without a page template around it

I would like to display a Drupal view without the page template that normally surrounds it - I want just the plain HTML content of the view's nodes. This view would be included in another, non-Drupal site. I expect to have to do this with a number…
ceejayoz
  • 165,698
  • 38
  • 268
  • 341
30
votes
5 answers

Creating list of similar nodes in Drupal 7/Views 3

Copy from drupal.stackexchange.com hoping to get more answers here: I face a rather common problem of displaying a list of nodes similar to current one. Similar node is defined as one having at least one taxonomy term that current node has. There…
Stanislav Kniazev
  • 5,040
  • 3
  • 33
  • 43
26
votes
2 answers

Drupal 7 Views 3 user:current filter is missing?

I'm trying to filter a view to display only nodes of the current user. Filter by user:current is missing however, where can it be found/enabled? I must be missing something simple.
stopshinal
  • 1,801
  • 4
  • 16
  • 24
20
votes
4 answers

Get the src of the image field in a view in drupal

We were working with Drupal 7 and trying to rewrite the views output We need the src of the image field , not the whole image tag. Clicking on Rewrite the output of this field [field_first_image] : Gives the whole content ie with tag , We tried…
Hari K T
  • 3,864
  • 3
  • 28
  • 50
15
votes
7 answers

How to change the label of the default value (-Any-) of an exposed filter in Drupal Views?

I created a view which has three exposed filters. Everything works fine except the fact that I can neither translate or change the default string (-Any-) for the dropdowns. Is there a way to change this string to something more meaningful like…
Ege Özcan
  • 12,341
  • 2
  • 28
  • 50
14
votes
5 answers

Drupal Views exposed filter of Author name as a drop down

This is a follow up question to Drupal Views exposed filter of Author name. The following question was answered and works. I can filter a view by user name. The user name is entered is entered by typing in a box and the box then auto completes.…
Linda
  • 2,107
  • 5
  • 29
  • 40
13
votes
6 answers

Drupal return number of results in a View

I have a view in Drupal that filters my content. It brings back 7 rows. All I want to return is the number or results returned(7). Is this possible? I tried using the View result counter but it returns a number for each results 1 2 3 4 5 6 7 I just…
Linda
  • 2,107
  • 5
  • 29
  • 40
13
votes
3 answers

Drupal Views: Display recent nodes created by user on profile page

I'm wondering how I can display the recently created nodes by a user on their profile page. I've created a new page for a user at /user/%user and I want to be able to display the latest nodes created by that user.
Conor Mongey
  • 765
  • 1
  • 5
  • 14
12
votes
5 answers

How to import a view in Drupal?

How I can Import a view to Drupal. I have an exported view that I need to import in a different Drupal Installation. I don't have an import option in the admin/structure/views? Thanks! Edit: I have found the solution. I have to log in as user 1 to…
perpetual_dream
  • 996
  • 5
  • 16
  • 49
12
votes
1 answer

Drupal 7 - custom View with custom table, no data showing up

I wrote a module to interface with Views 3 using Drupal 7, but when I create a view using my custom table as a data source, no data shows up. Here's my schema from MySQL: +-------------+------------+------+-----+---------+----------------+ | Field …
Sarah Vessels
  • 27,994
  • 29
  • 147
  • 217
12
votes
2 answers

Using node summary on custom view

I'm building a custom view ona drupal site and i added all the fields i wanted, but i can't seem to find out how to add the summary that i created for the node. Anyone can help? I've added Body, put it doesn't include the summary. Thanks
Eduardo Mello
  • 915
  • 3
  • 15
  • 32
11
votes
6 answers

How to conditionally hide a field in a drupal view?

I have two fields that I want to render but I only want the second one to display when the first one is empty. Short of overriding the field in a template file, can I do this using functionality in the built in views functionality?
Allain Lalonde
  • 85,857
  • 67
  • 175
  • 234
11
votes
4 answers

How to sort View results programmatically?

I'm trying to take the results of a view - using the function views_get_view_result() - and sort the array in a way I couldn't do from within the Views interface. So far so good. I've got a $rows variable with all of the stuff I need. Now... How do…
Ace
  • 4,423
  • 6
  • 36
  • 46
11
votes
5 answers

How to create a custom filter for the Drupal View's Module?

I have the Profile, CCK, and Views2 modules installed on a Drupal 6 site. I added a string field to the user profile. I can filter easily on preset values, thru the Views GUI builder, really nicely. However, I'd like the filter criteria to be…
user6824
  • 151
  • 1
  • 2
  • 7
1
2 3
99 100