Modify, create and publish a list view
A view is a saved way of looking at one content type's items: which columns, in which order, and which items. In the admin it is your working list. Make it public and visitors get a list page at its own address, such as /events.
What you need
- Edit permission on the content type to use views, and configuration permission on it to create, edit or delete them.
- A content type with some items. See Content types and fields explained.
Where views live
Click a content type in the sidebar. The page title is the name of the view you are looking at. Opening a content type shows the view you used last, or else a favorite, or else the oldest view.
The View menu in the page header lets you add the view to or remove it from your favorites, Edit view, export, import, jump to one of your favorites or to All views, and Create view. A row of small chips under the title summarizes the view: number of columns, sort, filters, items per page, Public with its address (or Not public), and the template.
Create a view
- On the content type's page, open View and choose Create view (or open All views and click New view).
- Enter a Label, for example
Upcoming events. The Developer name follows it; it is used in the view's default address. - Optionally add a Description, then click Create.
The new view opens in the editor with every custom field as a column, 25 items per page and a maximum of 1000. It is not public yet. The view editor has five tabs.
Columns tab
Columns are what the admin list shows, and what the view's search looks at.
- Open the Columns tab. Visible columns are shown, in order; Hidden columns are available.
- Drag a visible column to reorder it. Click Hide to remove it. Click Show on a hidden column to add it.
Besides your own fields you can show built-in columns: the primary field, Created at, Created by, Last modified at, Last modified by, Id, Is draft, Is published, Template and Route Path.
Sort tab
- Open the Sort tab and click Add sort.
- Choose the Field and a Direction, Ascending or Descending.
- Add more sorts if you need ties broken. Drag to reorder them, or click Remove.
With no sort, items come newest first by creation time. Repeater fields cannot be used for sorting.
Filter tab
A filter decides which items belong in the view. You build it from conditions.
- Open the Filter tab and click Add condition.
- Choose a Field, an Operator and, where needed, a value.
- To combine conditions, choose how the group joins them: AND (all must match), OR (any may match) or NOT. Click Add group for a nested group.
- Click Save filter.
The operators you can pick depend on the field type: equals, does not equal, contains, does not contain, starts with, does not start with, ends with, does not end with, is empty, is not empty, greater than, greater than or equal, less than, less than or equal, has, does not have, is true and is false. For example, a Number or Date field offers the comparisons; a Checkbox offers is true and is false.
Public tab: publish the view
- Open the Public tab.
- Tick Published.
- Set the Route path, the web address after your domain, for example
events/upcoming. - Choose the Template that draws the list. The default is Content item list view.
- Set Default items per page and Max items per page. The maximum must be at least the default.
- Decide on Ignore client filter and sort query params (below).
- Click Save public settings.
Visit the route path on your site. You should see a list of the content type's published items that match the filter. Drafts and unpublished items never appear on the public list.
Visitors and query parameters
By default a visitor can add a filter or sort to the address of a public view. If you tick Ignore client filter and sort query params, only the view's own filter and sort apply. Tick it whenever the filter is there for a reason, for example to hide items.
Details tab
Change the Label or Description and click Save. The Delete view danger zone deletes the view. Items are not affected, and the view's public address stops working.
Gotchas
- An unpublished view returns "not found" to visitors, even though it works in the admin. Tick Published.
- The home page view cannot be unpublished. You must choose a different home page first; see Set a content item as the home page.
- Route paths must be unique across items, views and site pages.
- New fields are not added to existing views. Show them on the Columns tab.
- A field used in a sort or filter cannot be deleted until you remove it from the view.