Views uses a lot of terminology to describe what it does, and while this terminology is generally meaningful to anybody who has been around Drupal and databases for awhile, much of this terminology is not inherently obvious.
- A view is some presentation of content; now, in real terms, it could mean a single piece of content, or multiple. Views, however, is primarily concerned with multiple pieces of content.
- Page View
- A page view is a view that is ordinarily presented in the main content area, as the entire page. Taxonomy views such as taxonomy/term and the Drupal front page are examples of page views.
- Block View
- A block view is presented as a block, similar to the navigation bar. Recent Updates and Popular Content are good examples of block views.
- List View
- The simplest type of View is the List View, which simply provides the content as an Unordered List, i.e, the
<UL>tag. Ordinarily, list views generally just display the title of the post, but they can display a lot more than that. For example, a List View of recent blog entries might look like this:
- I had a great day yesterday
25 minutes, 34 seconds ago
- My cat's antics
2 days, 5 hours ago
- Why I hate politics
7 days, 3 hours ago
On drupal.org, the 'New forum topics' could be a List View.
- I had a great day yesterday
- Table View
- Very similar to the list view, a table view provides information about the post in a one post per row format. Columns can be click-sortable, meaning that the user can click the header on the column and change how the view is sorted, though the site designer must be careful as these sorting choices are easily overridden by the view itself.
- Teaser View
- A teaser view displays the title of a post, plus the teaser, and links to the full view of a post. The best example of a teaser view is to look at the front page of http://drupal.org
- When views refers to a field, it is talking about the field that is displayed in a view. For example, the tracker view (which shows the user recently updated content in a table) lists the type, title, author, number of comments and age. Each of these entries is a field. Views only uses fields in List and Table views.
- Views can take arguments from the URL. For example, in the url http://drupal.org/taxonomy/term/1 the number '1' is an argument to the view. It is used to filter the view to be more specific.
- Argument Default
- When a View expects arguments, and an argument is not provided, the argument default describes the behavior of the View. There are essentially 3 types of behavior:
- It can display 'page not found' meaning that the argument is absolutely required, and if no argument is present it just 404s.
- It can assume the argument was optional, and ignore it not being there. In that case, it will simply display all values. For example, if the argument is supposed to be a User ID, the view would only include posts by that user. However, if the argument isn't provided, and the Argument Default were set to 'all values', then it would show posts from all users.
- It can provide a Summary View. In this mode, it generates a list of all possible arguments that have posts in the database, and provides a list that the user can click on. This is used in the Archive-style view. For example, take a view whose URL is set to 'archive'. If the Views argument is set to "Year + Month", and the default is set to "Summary View", calling 'archive' by itself would provide a list of month/year combinations that have posts, along with a summary of how many posts were found. Each of these would be a link to archive/CCYYMM which could then show all posts from that month.
- A filter is used to reduce the result set. For example, the very basic view with no settings will simply give all content available on the site. This is almost never actually useful, however! Instead, content is almost always filtered so that it provides only what is needed. The default Drupal front page view, for example, filters to content that is set as promote to front page, and additionally filters to content that is set published.
- Exposed Filter
- An exposed filter is a filter that the end user is allowed to set. This means that Views will provide a text box or a select box and the user can specify criteria. The most common use for this is to filter by specific taxonomy terms, and let the user choose them, but there are many other uses for this as well. Exposed filters only work on page views.
- Sort Criteria
- Content needs to be sorted in some way in order to be useful. In general, Drupal likes to sort content in descending (reverse) date order, meaning that content is presented newest first. This is great for the front page, but sometimes date is not the most important criteria. Often taxonomy pages should be sorted alphabetically, for example.
- Default View
- Views and modules that utilize Views can provide default views; these views will automatically appear on your system just by being installed. They can be enabled or disabled. They can also be 'overridden' by a creating a view with the same name. The easiest way to do this is to click 'add' next to the default view, modify the view as you like, and save it.