Log in Request my site

List and filter your contents

The Content list block shows your contents as cards, filtered and paginated. This article teaches you to choose what the list shows, to build its card and to offer filters, a search and pagination to your visitors.

Add a list

  1. Open in the editor the page that will hold the list, or a template. Add a block explains how to insert a block.
  2. Add the Content list block.
  3. In the Settings tab of the sidebar, Query panel, leave Query source on Content type.
  4. Under Content types, check the types to list, for example Projects. The list fills with their contents.

A list carries a List body, which arranges its cards in a grid or in flex. The list body carries an Item template: the card repeated for each content. The list body accepts three other blocks, described below: Exposed filters, Search and Pagination.

As long as no type is checked, the panel shows This list has no source yet. The list shows nothing on the site. This is the state of a list placed by a catalog creation: it is laid out, and you choose what it lists.

Choose what the list shows

The Query panel sets the content of the list.

The settings of the Query panel
SettingEffectDefault value
Query sourceContent type: the contents of the checked types. Reference: the contents that point to the displayed content. Siblings: the contents sorted like the one being read, in the template of a type that has a reference field. Archive: the contents of the archive page, in an archive or search template.Content type.
Apply site search termOn a results page, filters the list with the words the visitor searched for.Off.
Exclude hidden posts (noindex)Leaves out the contents hidden from search engines in their SEO settings.Off.
Content languageThe language of the listed contents. The section Choose the language of the list details it.The language of the page being read.
Different template per post typeWith several types checked, gives each type its own card.Off.

Link your contents to each other details the sources Reference and Siblings.

Give each type a card

  1. Check at least two types under Content types, then turn on Different template per post type.
  2. Duplicate the Item template as many times as there are types.
  3. On each card, Post type assignment panel, choose the type in This template applies to.

The card left on Default (fallback) serves the types that do not have their own.

Choose the language of the list

On a multilingual site, Content language decides which language the list draws from. The setting appears only from two languages.

The values of Content language
ValueResult for the visitor
The language of the page being readThe list speaks the language of the page that holds it: French contents on the French page, English contents on its translation.
Every languageAll the languages are mixed in the list.
A named language, for example French (France)The list always draws from this language, whatever the page.

The language holds from one page of the list to the next, when the visitor filters and when they search in the list. A content that has no language is always listed.

Build the card

The Item template is the card repeated for each content. A new card carries two blocks: a level 2 Heading that shows the title of the content and leads to it, then the Post excerpt.

You add to the card the blocks you want. Each content shows its own values in it. To find the fields of the listed type in the inserter, first select a block of the card. Show the data of a content explains how to show a title, a date or a field.

The media blocks of a card
BlockDisplay
Post thumbnailThe featured media of the content, image or video.
Post mediaFor a media list, the file itself. For another type, its featured media.

In the editor, these two blocks show a preview, marked Preview (will use the actual post media). On the site, each card shows its own. A content with no featured media shows none: the following blocks move up.

A video media is set in their Video settings panel, for all the cards: On hover animates each card when the pointer is on it.

Mark the card of the page being read

When a list shows the page the visitor is reading, the card of that page takes the Active state. Style it in the Styles tab of the card. To also change what it contains, turn on Pass the active state to children: its blocks take the Active state with it.

Set the link of the card

A new card leads to its content in two ways. A click anywhere on its surface opens it, with no address written in the page. Its title is a real link, the one that search engines and the keyboard follow.

The link of the card is set in its Link panel, Settings tab.

The settings of a card’s link
SettingEffectDefault value
TargetWhere the card leads. Link to the item leads each card to its own content.Link to the item.
Hide the link from search enginesThe card writes no address in the page: the site opens the target on click.On.
Open in a new tabOpens the target in a new tab. Grayed out as long as the link is hidden.Off.
The other possible link settings
You wantDoResult
A card with no linkClick Remove link on the target.Only the links of its blocks lead anywhere.
A card that is a real linkTurn off Hide the link from search engines.The address of each content is written over the whole card.
A card to another addressChoose another target in the field.All the cards lead to the same address.

On a hidden card, Ctrl+click opens the content in a new tab. A click on a link in the card, like its title or a button, follows that link.

Offer filters

The Exposed filters block lets your visitors narrow the list. Add it in the List body, then in its Exposed filters panel check the filters to offer.

The Exposed filters panel of a list of projects: the Maintenance contract field checked, a named range called Under 100 m² on the Garden area with the condition Less than or equal to and the value 100, the Garden area checked under Let visitors sort by, then the Garden type reference checked, set to Dynamic (auto).
The groups of the Exposed filters panel
GroupResult for the visitor
ReferencesOne filter per reference field of the listed types, for example by city or by brand.
Content fieldsOne filter per field marked Filterable on its type. A Choice or Yes / no field becomes checkboxes.
Named rangesRanges that you write in your own words, for example “Under €200,000”.
Let visitors sort byA Sort by choice on the fields marked Sortable, in ascending or descending order.

Each checked filter has its Order, which places the filters among themselves. A reference also has its Input type: Dynamic (auto) or Always dropdown.

Several values checked in the same filter widen the result: Nike or Adidas. Two different filters narrow it: Nike and Running.

Add fields to a type explains how to mark a field Filterable or Sortable.

Write a named range

A price or an area has no list to check. A named range creates one.

  1. In the Named ranges group, click Add a range.
  2. In Label shown to visitors, write the range, for example Under €200,000.
  3. In Field, choose the field, for example Price.
  4. In Condition, choose the comparison.
  5. In Value, enter the number, for example 200000. For a range between two bounds, enter two values separated by a comma: 200000,400000.
The conditions of a named range
ConditionThe content falls in the range when the field…Field types
Is filled, Is emptyhas a value, or is empty.All
Equals, Does not equalequals the value, or does not.Numbers and texts. Equals also applies to dates and times.
Greater than, Greater than or equal tois greater than, or greater than or equal to, the value.Numbers
Less than, Less than or equal tois less than, or less than or equal to, the value.Numbers
Before, Afteris before, or after, the value.Dates and times
Betweenis between the two values.Numbers, dates and times
Containscontains the value.Texts
Is on, Is offis Yes, or No.Yes / no
Is, Is not, Is one ofis the choice, is not the choice, or is one of the choices.Choice

The Condition list offers only the comparisons for the type of the chosen field. A range belongs to the page that holds it: duplicating the page duplicates its ranges.

Sort without losing content

A sort never removes a content from the list. Contents with no value for the field go last, in both directions. Default order brings the list back unsorted.

The chosen filters and sort stay applied from one page of the list to the next. As long as Hide navigation from search engines (AJAX) is off, they are written in the address with the page number, whether the list is on a page or in the template of a content. The address can be shared as is. A filtered address names the unfiltered page as the reference address for Google. With AJAX navigation, the address does not change.

Add a search

The Search block goes in a list or on its own, anywhere on the site, for example in the header. Its Search settings panel offers a Behavior depending on that location.

The behaviors of the Search block
BehaviorLocationResult for the visitor
Classic (results page), defaultOn its own or in a listIt submits and arrives on the results page. The address can be shared and search engines explore it.
Live results (in place)In a listThe list fills again in place, without the page changing.
Live dropdownOn its ownSuggestions show under the field as they type. They choose a content in the list.
Modal (composition)On its ownThe field opens a composition in a modal, where you placed the search and its list.

On its own and in Classic mode, the block carries Search the current post type, turned on by default. It searches the type of the page being viewed. On the home page, it searches the whole site. Turned off, it always searches the whole site.

A block moved to where its mode does not exist goes back to Classic. The block’s field and button cannot be changed, but they are styled like form fields. Each search is recorded in your statistics.

Paginate the list

The Pagination panel of the list sets the number of results. Add the Pagination block in the List body so the visitor can move from page to page.

The settings of the Pagination panel
SettingEffectDefault value
Use WordPress reading settingTakes the number of contents per page from the reading settings.On.
Results per pageThe number of contents per page, when the previous setting is off. The editor preview stops at 20.20.
Maximum pagesThe number of pages offered. 0 means unlimited. Offered with a Pagination block.20.
Hide navigation from search engines (AJAX)Only the list refreshes on click and no page address exists. Offered with a Pagination block.Off.
Classic navigation and AJAX navigation
ClassicAJAX
On clickThe page reloads and the address changes.Only the list refreshes.
Search enginesEach page of the list has an address that can be explored.No address to explore.
Share a page of the listYes.No.
Browser Back buttonIt goes back to the previous page of the list.It goes back to the page visited before the list.

The Pagination block has its Display setting: Numbered pages, with Show first and last page links checked by default, or Previous / Next, the arrows only.

In both modes, the navigation and the filters work with the keyboard. A screen reader announces the number of results after a filter and the page reached, for example “Page 3 of 7”.

Set the empty list

The Empty state panel of the list sets how a list with no result is displayed. When there are no results: Show a message, by default, with the text of your choice in Message, or Hide the list.

A list that carries a search or filters keeps its controls visible even when empty. Only a list with no controls and no results disappears.

See also

Updated on

All documentation pages