Listing Content With Views

Views is a powerful tool for creating and displaying lists of content in Drupal.

Views display types

Page

Pages have a URL, and can create a menu link or tab.

You can define parameters in the URL to use as filter arguments.

Block

Place views listings on other pages as blocks.

Other

Attachment, Embed, Entity Reference, Feed.

Views display formats

Here are the default formats provided.

Unformatted list

The default style simply lists content with a div for each row.

Entity or field display.

Rows can be grouped by a field.

HTML list

List content with an ordered or unordered list.

Table

List content as a table.

Columns can be sorted.

Responsive grid

Provides a configurable grid.

Fields vs Display mode

You can display a list of content using it's display mode, or select specific fields to display.

If you use a display mode, configure how it looks outside the view, and just use the view to control the sort and filtering.

If you use fields, you can define how each field is displayed in the view.

Rearrange fields

If you're displaying fields in your view, there is a button to rearrange the order of the fields.

There is also a quick way to bulk delete fields in the dialog.

If you want to use a field's value inside another field using twig, you will need it to be displayed before it.

Hidden fields

Fields can be added to the view and set as hidden when you want to use the value in another field.

Filters

Exposed Filters

Filters can be exposed, giving the user control over over the filtering value.

Exposed Form Settings

Expose your filter form as a block to place it somewhere else.

Administrative Views

The content admin listing is built with Views, so you can modify it. For example, you could add extra fields to display.

Default home page view

When you install the standard Drupal profile, it is set up with a view as the home page. This will list article content you create. If you create new content types, those will be shown here too.

It uses the teaser display mode, so you can configure different content types to show different fields in the listing.

If you replace this with your own home page, you may want to disable or delete this one. Otherwise it will expose all your site's content at /node.

Groups

Views can group items by a field, such as the content type or a taxonomy term.

Views Display Grouping

Image
Drupal views group

Views Group Field Settings

Image
Drupal views group field settings
Tags
Views
Modules