# Pages section

List and edit subpages

****

- Source: <https://github.com/getkirby/kirby/tree/5.5.3/config/sections/pages.php>

****

## What is a pages section?

A pages section lists the children of a given parent or a set of pages defined by a query. Pages sections also let you do the following operations (if not forbidden or impossible because of other settings):

- create a new page
- delete a page
- change the status of a page
- move a page
- duplicate a page
- change the page slug
- change the page template
- change the order number

<figure class="image"><a data-lightbox href="https://assets.getkirby.com/media/pages/docs/reference/panel/sections/pages/cb0d3e5558-1717846665/pages-section.png?width=1416&amp;height=1416&amp;enlarge=0"><img alt="" class="rounded" height="924" loading="lazy" sizes="auto" src="https://assets.getkirby.com/media/pages/docs/reference/panel/sections/pages/cb0d3e5558-1717846665/pages-section.png?width=924&amp;height=924&amp;enlarge=0" srcset="https://assets.getkirby.com/media/pages/docs/reference/panel/sections/pages/cb0d3e5558-1717846665/pages-section.png?width=462&amp;height=462&amp;enlarge=0 462w, https://assets.getkirby.com/media/pages/docs/reference/panel/sections/pages/cb0d3e5558-1717846665/pages-section.png?width=690&amp;height=690&amp;enlarge=0 690w, https://assets.getkirby.com/media/pages/docs/reference/panel/sections/pages/cb0d3e5558-1717846665/pages-section.png?width=924&amp;height=924&amp;enlarge=0 924w, https://assets.getkirby.com/media/pages/docs/reference/panel/sections/pages/cb0d3e5558-1717846665/pages-section.png?width=1380&amp;height=1380&amp;enlarge=0 1380w, https://assets.getkirby.com/media/pages/docs/reference/panel/sections/pages/cb0d3e5558-1717846665/pages-section.png?width=1416&amp;height=1416&amp;enlarge=0 1848w" width="924"></a></figure>

## Example

```yaml
title: Shop

sections:

  drafts:
    label: Drafts
    type: pages
    status: draft
    templates: product

  published:
    label: Published Products
    type: pages
    status: listed
    templates: product
```

(screencast: https://www.youtube.com/watch?v=rVcg4SlAh-A poster: youtube-section.jpg title: A closer look at pages sections text: Show subpages as cards or list, add additional info for each page, control the card design – there are hardly any limits.)

<info>
<p>Sections do not store anything in the content file, which means that you cannot fetch content from a section in your templates like you would from field content.</p>
</info>

## Section shortcuts
For simple sections that are only used once per blueprint, you can use shortcuts. In its most basic form, a `pages` section consists of the section type as name, and  `true` as its value.

```yaml
sections:

  pages: true
```
This will add a `pages` section with all default properties.

These shortcuts can be extended with other section properties as needed, for example:

```yaml
sections:

  pages:
    label: Main Pages
    status: all
```
Keep in mind that the same section name can only be used once per blueprint.

## Section properties

The pages section has multiple options to control what kind of pages should be displayed, how they should be displayed and what happens if a new page is added.



<div class="table">
	<table class="parameters">
		<thead>
			<tr>
				<th>Name</th>
				<th>Type</th>
				<th>Default</th>

								<th>Description</th>
							</tr>
		</thead>
		<tbody>
						<tr>
				<td>
					batch				</td>
				<td><code class="type type-bool">bool</code></td>

				<td data-label="Default:">
															<code>false</code>
									</td>

								<td>Activates the batch delete option for the section</td>
							</tr>
						<tr>
				<td>
					columns				</td>
				<td><code class="type type-array">array</code></td>

				<td data-label="Default:">
															<code>null</code>
									</td>

								<td>Columns config for <code class="type">layout: table</code></td>
							</tr>
						<tr>
				<td>
					create				</td>
				<td><code class="type type-mixed">mixed</code></td>

				<td data-label="Default:">
															<code>null</code>
									</td>

								<td>Optional array of templates that should only be allowed to add or <code class="type type-bool">false</code> to completely disable page creation</td>
							</tr>
						<tr>
				<td>
					empty				</td>
				<td><code class="type type-mixed">mixed</code></td>

				<td data-label="Default:">
															<code>null</code>
									</td>

								<td>Sets the text for the empty state box</td>
							</tr>
						<tr>
				<td>
					flip				</td>
				<td><code class="type type-bool">bool</code></td>

				<td data-label="Default:">
															<code>false</code>
									</td>

								<td>Enables/disables reverse sorting</td>
							</tr>
						<tr>
				<td>
					headline				</td>
				<td><code class="type type-mixed">mixed</code></td>

				<td data-label="Default:">
															<code>null</code>
									</td>

								<td>The headline for the section. This can be a simple string or a template with additional info from the parent page.</td>
							</tr>
						<tr>
				<td>
					help				</td>
				<td><code class="type type-mixed">mixed</code></td>

				<td data-label="Default:">
															<code>null</code>
									</td>

								<td>Sets the help text</td>
							</tr>
						<tr>
				<td>
					image				</td>
				<td><code class="type type-mixed">mixed</code></td>

				<td data-label="Default:">
															<code>null</code>
									</td>

								<td>Image options to control the source and look of preview</td>
							</tr>
						<tr>
				<td>
					info				</td>
				<td><code class="type type-mixed">mixed</code></td>

				<td data-label="Default:">
															<code>null</code>
									</td>

								<td>Optional info text setup. Info text is shown on the right (lists, cardlets) or below (cards) the title.</td>
							</tr>
						<tr>
				<td>
					label				</td>
				<td><code class="type type-mixed">mixed</code></td>

				<td data-label="Default:">
															<code>null</code>
									</td>

								<td>The label for the section. This can be a simple string or a template with additional info from the parent page. Replaces the <code class="type">headline</code> prop.</td>
							</tr>
						<tr>
				<td>
					layout				</td>
				<td><code class="type type-string">string</code></td>

				<td data-label="Default:">
															<code>'list'</code>
									</td>

								<td>Section layout. Available layout methods: <code class="type">list</code>, <code class="type">cardlets</code>, <code class="type">cards</code>, <code class="type">table</code>.</td>
							</tr>
						<tr>
				<td>
					limit				</td>
				<td><code class="type type-int">int</code></td>

				<td data-label="Default:">
															<code>20</code>
									</td>

								<td>Sets the number of items per page. If there are more items the pagination navigation will be shown at the bottom of the section.</td>
							</tr>
						<tr>
				<td>
					max				</td>
				<td><code class="type type-int">int</code></td>

				<td data-label="Default:">
															<code>null</code>
									</td>

								<td>Sets the maximum number of allowed entries in the section</td>
							</tr>
						<tr>
				<td>
					min				</td>
				<td><code class="type type-int">int</code></td>

				<td data-label="Default:">
															<code>null</code>
									</td>

								<td>Sets the minimum number of required entries in the section</td>
							</tr>
						<tr>
				<td>
					page				</td>
				<td><code class="type type-int">int</code></td>

				<td data-label="Default:">
															<code>null</code>
									</td>

								<td>Sets the default page for the pagination.</td>
							</tr>
						<tr>
				<td>
					parent				</td>
				<td><code class="type type-string">string</code></td>

				<td data-label="Default:">
															<code>null</code>
									</td>

								<td>Sets the query to a parent to find items for the list</td>
							</tr>
						<tr>
				<td>
					query				</td>
				<td><code class="type type-string">string</code></td>

				<td data-label="Default:">
															<code>null</code>
									</td>

								<td>Filters pages by a query. Sorting will be disabled</td>
							</tr>
						<tr>
				<td>
					rawvalues				</td>
				<td><code class="type type-bool">bool</code></td>

				<td data-label="Default:">
															<code>false</code>
									</td>

								<td>Whether the raw content file values should be used for the table column previews. Should not be used unless it eases performance issues in your setup introduced with Kirby 4.2</td>
							</tr>
						<tr>
				<td>
					search				</td>
				<td><code class="type type-bool">bool</code></td>

				<td data-label="Default:">
															<code>false</code>
									</td>

								<td>Enable/disable the search in the sections</td>
							</tr>
						<tr>
				<td>
					size				</td>
				<td><code class="type type-string">string</code></td>

				<td data-label="Default:">
															<code>'auto'</code>
									</td>

								<td>The size option controls the size of cards. By default cards are auto-sized and the cards grid will always fill the full width. With a size you can disable auto-sizing. Available sizes: <code class="type">tiny</code>, <code class="type">small</code>, <code class="type">medium</code>, <code class="type">large</code>, <code class="type">huge</code>, <code class="type">full</code></td>
							</tr>
						<tr>
				<td>
					sortBy				</td>
				<td><code class="type type-string">string</code></td>

				<td data-label="Default:">
															<code>null</code>
									</td>

								<td>Overwrites manual sorting and sorts by the given field and sorting direction (i.e. <code class="type">date desc</code>)</td>
							</tr>
						<tr>
				<td>
					sortable				</td>
				<td><code class="type type-bool">bool</code></td>

				<td data-label="Default:">
															<code>true</code>
									</td>

								<td>Enables/disables manual sorting</td>
							</tr>
						<tr>
				<td>
					status				</td>
				<td><code class="type type-string">string</code></td>

				<td data-label="Default:">
															<code>''</code>
									</td>

								<td>Filters pages by their status. Available status settings: <code class="type">draft</code>, <code class="type">unlisted</code>, <code class="type">listed</code>, <code class="type">published</code>, <code class="type">all</code>.</td>
							</tr>
						<tr>
				<td>
					template				</td>
				<td><code class="type type-array">array</code><span class="px-1 color-gray-400" aria-hidden="true">|</span><span class="sr-only">or</span><code class="type type-string">string</code></td>

				<td data-label="Default:">
															<code>null</code>
									</td>

								<td>Filters the list by single template.</td>
							</tr>
						<tr>
				<td>
					templates				</td>
				<td><code class="type type-mixed">mixed</code></td>

				<td data-label="Default:">
															<code>null</code>
									</td>

								<td>Filters the list by templates and sets template options when adding new pages to the section.</td>
							</tr>
						<tr>
				<td>
					templatesIgnore				</td>
				<td><code class="type type-mixed">mixed</code></td>

				<td data-label="Default:">
															<code>null</code>
									</td>

								<td>Excludes the selected templates.</td>
							</tr>
						<tr>
				<td>
					text				</td>
				<td><code class="type type-mixed">mixed</code></td>

				<td data-label="Default:">
															<code>'{{ model.title }}'</code>
									</td>

								<td>Setup for the main text in the list or cards. By default this will display the title.</td>
							</tr>
					</tbody>
	</table>
</div>

## Label

The label will be displayed above the pages section. You can pass a simple label as a string or you can provide translations for multiple languages, if you have an international editing team.

### Single language

```yaml
label: Articles
```

### Multiple languages
```yaml
label:
  en: Articles
  de: Artikel
  es: Artículos
```

### Placeholders

You can inject information from the current page into the label with template placeholders using our <a href="https://getkirby.com/docs/guide/blueprints/query-language">query language</a>.

```yaml
label: "Articles for {{ page.title }}"
```

## Layout

The pages can either be displayed as a simple list or as cards with preview images. The list view is the default view.

### List layout (default)

The `list` layout is perfect for more text-heavy pages, like articles, link lists, simple pages, etc.

```yaml
layout: list
```

<figure class="image"><a data-lightbox href="https://assets.getkirby.com/media/pages/docs/reference/panel/sections/pages/5c82c05e0b-1717846665/pages-section-list.png?width=1416&amp;height=860&amp;enlarge=0"><img alt="" class="rounded" height="561" loading="lazy" sizes="auto" src="https://assets.getkirby.com/media/pages/docs/reference/panel/sections/pages/5c82c05e0b-1717846665/pages-section-list.png?width=924&amp;height=561&amp;enlarge=0" srcset="https://assets.getkirby.com/media/pages/docs/reference/panel/sections/pages/5c82c05e0b-1717846665/pages-section-list.png?width=462&amp;height=281&amp;enlarge=0 462w, https://assets.getkirby.com/media/pages/docs/reference/panel/sections/pages/5c82c05e0b-1717846665/pages-section-list.png?width=690&amp;height=419&amp;enlarge=0 690w, https://assets.getkirby.com/media/pages/docs/reference/panel/sections/pages/5c82c05e0b-1717846665/pages-section-list.png?width=924&amp;height=561&amp;enlarge=0 924w, https://assets.getkirby.com/media/pages/docs/reference/panel/sections/pages/5c82c05e0b-1717846665/pages-section-list.png?width=1380&amp;height=838&amp;enlarge=0 1380w, https://assets.getkirby.com/media/pages/docs/reference/panel/sections/pages/5c82c05e0b-1717846665/pages-section-list.png?width=1416&amp;height=860&amp;enlarge=0 1848w" width="924"></a></figure>

### Cards layout

The `card` layout is great for media-heavy pages, like galleries, products, projects, etc.

```yaml
layout: cards
```

<figure class="image"><a data-lightbox href="https://assets.getkirby.com/media/pages/docs/reference/panel/sections/pages/907e12def5-1717846665/pages-section-cards.png?width=1776&amp;height=2232&amp;enlarge=0"><img alt="" class="rounded" height="1161" loading="lazy" sizes="auto" src="https://assets.getkirby.com/media/pages/docs/reference/panel/sections/pages/907e12def5-1717846665/pages-section-cards.png?width=924&amp;height=1161&amp;enlarge=0" srcset="https://assets.getkirby.com/media/pages/docs/reference/panel/sections/pages/907e12def5-1717846665/pages-section-cards.png?width=462&amp;height=581&amp;enlarge=0 462w, https://assets.getkirby.com/media/pages/docs/reference/panel/sections/pages/907e12def5-1717846665/pages-section-cards.png?width=690&amp;height=867&amp;enlarge=0 690w, https://assets.getkirby.com/media/pages/docs/reference/panel/sections/pages/907e12def5-1717846665/pages-section-cards.png?width=924&amp;height=1161&amp;enlarge=0 924w, https://assets.getkirby.com/media/pages/docs/reference/panel/sections/pages/907e12def5-1717846665/pages-section-cards.png?width=1380&amp;height=1734&amp;enlarge=0 1380w, https://assets.getkirby.com/media/pages/docs/reference/panel/sections/pages/907e12def5-1717846665/pages-section-cards.png?width=1776&amp;height=2232&amp;enlarge=0 1848w" width="924"></a></figure>

<h3 id="__cardlets-layout"><a href="#__cardlets-layout" tabindex="-1">Cardlets layout</a></h3>
<p>The <code class="type">cardlets</code> layout is great for nice visual previews of files, while your text content is still representend decently.</p>
<figure class="code">
<pre><code class="language-yaml">layout: cardlets</code></pre>
</figure>

<figure class="image"><a data-lightbox href="https://assets.getkirby.com/media/pages/docs/reference/panel/sections/pages/11373ce69d-1717846665/pages-section-cardlets.png?width=2136&amp;height=880&amp;enlarge=0"><img alt="" class="rounded" height="381" loading="lazy" sizes="auto" src="https://assets.getkirby.com/media/pages/docs/reference/panel/sections/pages/11373ce69d-1717846665/pages-section-cardlets.png?width=924&amp;height=381&amp;enlarge=0" srcset="https://assets.getkirby.com/media/pages/docs/reference/panel/sections/pages/11373ce69d-1717846665/pages-section-cardlets.png?width=462&amp;height=190&amp;enlarge=0 462w, https://assets.getkirby.com/media/pages/docs/reference/panel/sections/pages/11373ce69d-1717846665/pages-section-cardlets.png?width=690&amp;height=284&amp;enlarge=0 690w, https://assets.getkirby.com/media/pages/docs/reference/panel/sections/pages/11373ce69d-1717846665/pages-section-cardlets.png?width=924&amp;height=381&amp;enlarge=0 924w, https://assets.getkirby.com/media/pages/docs/reference/panel/sections/pages/11373ce69d-1717846665/pages-section-cardlets.png?width=1380&amp;height=569&amp;enlarge=0 1380w, https://assets.getkirby.com/media/pages/docs/reference/panel/sections/pages/11373ce69d-1717846665/pages-section-cardlets.png?width=1848&amp;height=761&amp;enlarge=0 1848w" width="924"></a></figure>

### Table layout

The table layout has the highest information density. Columns can be fully customized and make it perfect if you need to show multiple values at once for better overview and scannability.

<figure class="image"><a data-lightbox href="https://assets.getkirby.com/media/pages/docs/reference/panel/sections/pages/b7c20dcf97-1717846665/pages-section-table.png?width=2136&amp;height=1584&amp;enlarge=0"><img alt="" class="rounded" height="685" loading="lazy" sizes="auto" src="https://assets.getkirby.com/media/pages/docs/reference/panel/sections/pages/b7c20dcf97-1717846665/pages-section-table.png?width=924&amp;height=685&amp;enlarge=0" srcset="https://assets.getkirby.com/media/pages/docs/reference/panel/sections/pages/b7c20dcf97-1717846665/pages-section-table.png?width=462&amp;height=343&amp;enlarge=0 462w, https://assets.getkirby.com/media/pages/docs/reference/panel/sections/pages/b7c20dcf97-1717846665/pages-section-table.png?width=690&amp;height=512&amp;enlarge=0 690w, https://assets.getkirby.com/media/pages/docs/reference/panel/sections/pages/b7c20dcf97-1717846665/pages-section-table.png?width=924&amp;height=685&amp;enlarge=0 924w, https://assets.getkirby.com/media/pages/docs/reference/panel/sections/pages/b7c20dcf97-1717846665/pages-section-table.png?width=1380&amp;height=1023&amp;enlarge=0 1380w, https://assets.getkirby.com/media/pages/docs/reference/panel/sections/pages/b7c20dcf97-1717846665/pages-section-table.png?width=1848&amp;height=1370&amp;enlarge=0 1848w" width="924"></a></figure>

```yaml
layout: table
```

The table layout will show the preview image together with a title and info column based on your text and info settings. You can switch off those automatic columns with `image: false`, `text: false` and `info: false` if you want to introduce your own columns.

#### Columns

Custom table columns can be defined with the `columns` option.

```yaml
layout: table
columns:
  subheading: true
  date: true
```

Each column can be customized with additional settings:

##### Label

```yaml
layout: table
columns:
  subheading:
    label: Subheading
```

##### Translated label

```yaml
layout: table
columns:
  subheading:
    label:
      en: Subheading
      de: Unterüberschrift
```

##### Alignment

Text alignment can be left (default), center or right.

```yaml
layout: table
columns:
  subheading:
    label: Subheading
    align: right
```

##### Width

The column width can be set with the `width` property.  You can use the usual fractions:

```yaml
layout: table
columns:
  info: false
  subheading:
    label: Subheading
    width: 1/3
  title:
    width: 1/3
  date:
    width: 1/6
  tags:
    width: 1/6
```

##### Value

By default, the table cells contain the field value matching the column name. You can customize the value with a string template.

```yaml
layout: table
columns:
  date:
    label: Date
    value: "on {{ page.date.toDate('d.m.Y') }}"
    type: text
```

If the page actually has a `date` field of type `date`, Kirby will automatically use the date field preview component for this column. However, this will clash with your custom value. This is why we also set `type: text`.

##### HTML

Values are converted to safe HTML by default. This is the most secure way to handle content in your Panel. If you know what you are doing and you want to render HTML in a table cell, you can use the html option to stop HTML from being auto-encoded.

```yaml
layout: table
columns:
  html:
    label: HTML
    type: html
    value: "{{ page.someSafeHTML }}"
```

##### Mobile

Set the `mobile` option to `true` for a column to be visible in the mobile view.

```yaml
layout: table
columns:
  subheading:
    label: Subheading
    mobile: true
```

##### Type

To display different content, you can use column types to improve the preview of your data, e.g. `text`, `url`, `tags`.

Check out the [field previews in our Lab](https://lab.getkirby.com/public/lab/components/fieldpreviews/array) to get an overview of the various previews that can be used as column types.

##### Customizing default columns

```yaml
layout: table
info: "{{ page.slug }}"
columns:
  title:
    label: Custom title label
  info:
    label: Custom slug label
    width: 10rem
```

## Page information

You can fine-tune the display text and additional information for every page in the list with the `text` and `info` options.

### `text`

By default the page title is shown in the list for every page. You can use our template syntax with <a href="https://getkirby.com/docs/guide/blueprints/query-language">query language</a> to fetch any information from the page and display that instead of the title.

```yaml
text: " {{ page.title.upper }}"
```

### `info`

If you want to display additional information for each page, like a date, year, category or any other field value, you can use the template syntax with <a href="https://getkirby.com/docs/guide/blueprints/query-language">query language</a> in the `info` option.

```yaml
info: " {{ page.date.toDate('Y-m-d') }}"
```

## Preview images

The (preview) image for each item in the list is by default what is <a href="https://getkirby.com/docs/reference/panel/blueprints/page#image-options">configured in the respective page blueprint</a>. However, you can customize these further for your section with the <a href="https://getkirby.com/docs/reference/panel/blueprints/page#image-options">same options</a> as in the page blueprint:

```yaml
type: pages
image:
  query: page.cover.toFile
  icon: 📝
  back: blue-700
  color: white
  cover: true
```

## Empty state

With the `empty` option you can define the message which is displayed when no pages are listed in the section.

```yaml
empty: No articles yet
```

## Filtering pages

### Parent

By default, the current page is being used as the parent to find children for the list. With this option, any page on your site can be the parent of the section

```yaml
parent: site.find("blog")
```

### `query`

The pages section supports a query option to filter the pages that are shown in a section using our <a href="https://getkirby.com/docs/guide/blueprints/introduction#query-language">query string syntax</a>. Manual sorting will be disabled for sections with a query.

```yaml
videoPosts:
  type: pages
  label: Video posts
  query: page.childrenAndDrafts.filterBy('category', 'video')
  template: article

otherPosts:
  type: pages
  label: Other posts
  query: page.childrenAndDrafts.filterBy('category', '!=', 'video')
  template: article
```
The query option cannot only be used in the context of a single page, but you can also query the complete site index if that makes sense, for example in `site.yml`:

```yaml
siteIndex:
  type: pages
  query: site.index(true).notIn(['error'])
  create: default
```

### Status

You can filter the list of pages by their status. The available status values are

| Status        | Description |
| -             | -           |
| `draft`         | Only drafts will be shown |
| `listed`        | Only listed pages (with a sorting number) will be shown |
| `unlisted`      | Only unlisted pages (without a sorting number) will be shown |
| `published`     | Listed and unlisted pages will be shown |
| `all (default)` | Drafts, listed and unlisted pages will be shown |

```yaml
status: draft
```

Note that an "Add" button for new pages will only be available if you use either `status: draft` or `status: all`.

### Templates

You can define a list of templates that will be available when adding new pages to the section. It  will also be used to filter pages to be contained in the list.

#### Single template
```yaml
template: article
```

#### Multiple templates
```yaml
templates:
  - project
  - article
```

<info>
If only one template is available when [adding a new page](#add-button), the template select will be hidden in the dialog (except when the [`debug` option](/docs/reference/system/options/debug) is active).
</info>

## "Add" button

Editors can add new pages to the section with the "Add" button in the top right corner.

| `status: all` | `status: draft` | `status: listed` | `status: unlisted` |
| -             | -               | -                | -                  |
| + Add         | + Add           |                  |                    |

<info>The add button will only show up if the status option is set to `draft` or `all`</info>

### Why?

New pages are always added as draft. If the "Add" button showed up in sections that only show listed or unlisted pages, the "Add" button would lead to a confusing interaction for editors, as the new page would not show up in the section.

<since v="5.0.0">
## Batch delete pages

When managing many pages, it can be tedious to delete them one by one. Adding `batch: true`, allows you to select multiple pages and delete them at once.

```yml
notes:
  type: pages
  batch: true
```
</since>

## Sorting

### `sortBy`

You can sort the list of pages by one or more fields/properties in descending or ascending order.

```yaml
sortBy: date desc
sortBy: date desc title asc
sortBy: status desc year desc
```

You can pass <a href="https://www.php.net/manual/en/function.sort.php">PHP sorting type flags</a>, for example to make sorting work with special language specific characters.

```yaml
sortBy: title SORT_LOCALE_STRING
sortBy: title asc SORT_LOCALE_STRING
```

<info>
The `sortBy` option only has an effect on the display order inside this section in the Panel. Because all pages will always be sorted by the field/property you defined, manual drag and drop sorting inside the section is disabled.

However each page can still have its own sorting number, which can be controlled via the page status dialog. If you don't need or want the custom sorting numbers, you need to disable them with the <a href="https://getkirby.com/docs/reference/panel/blueprints/page#sorting">`num` option of the child page blueprint</a>.
</info>

### `flip`

Use the `flip` option to enable/disable reverse sorting (default is `false`):

```yaml
sortBy: title
flip: true
```

### `sortable`

You can switch off manual sorting entirely with the `sortable` option.

```yaml
sortable: false
```

## Limits

### `limit`

The limit property sets how many pages will be shown per page. If there are more entries in the section, the pagination navigation will be shown at the bottom of the section.

```yaml
limit: 20
```

### `max`

You can define a maximum number of pages, that will be allowed in this section. After the maximum is reached, the add button will be hidden and no more pages can be added.

```yaml
max: 10
```

### `min`

You can also define the minimum number of pages, that need to be added in order to make the page valid.

```yaml
min: 2
```

<h2 id="conditional-sections"><a href="#conditional-sections" tabindex="-1">Conditional sections</a></h2>
<p>Like <a href="https://getkirby.com/docs/guide/blueprints/fields#conditional-fields">conditional fields</a>, sections can be shown/hidden based on the value of a given field (i.e. if a toggle is checked, a select field is at a certain option, etc.).</p>
<p>The condition for displaying the section is set with the <code class="type">when</code> option. In the <code class="type">when</code> option you define a field name as the key and the required value of that field. In the following example, the each section type is shown based on a different value of the <code class="type">postType</code> field:</p>
<figure class="code">
<pre><code class="language-yaml">sections:
  content:
    type: fields
    fields:
      postType:
        type: select
        options:
          - Gallery
          - Image
          - Text
  gallery:
    type: files
    template: gallery-image
    layout: cards
    size: tiny
    when:
      postType: Gallery
  image:
    type: files
    template: single-image
    max: 1
    layout: cards
    when:
      postType: Image
  text:
    type: fields
    fields:
      text:
        type: textarea
      tags:
        type: tags
    when:
      postType: Text</code></pre>
</figure>

## Search

<figure class="image"><a data-lightbox href="https://assets.getkirby.com/media/pages/docs/reference/panel/sections/pages/392afe3003-1717846665/pages-section-search.png?width=1776&amp;height=400&amp;enlarge=0"><img alt="" class="rounded" height="208" loading="lazy" sizes="auto" src="https://assets.getkirby.com/media/pages/docs/reference/panel/sections/pages/392afe3003-1717846665/pages-section-search.png?width=924&amp;height=208&amp;enlarge=0" srcset="https://assets.getkirby.com/media/pages/docs/reference/panel/sections/pages/392afe3003-1717846665/pages-section-search.png?width=462&amp;height=104&amp;enlarge=0 462w, https://assets.getkirby.com/media/pages/docs/reference/panel/sections/pages/392afe3003-1717846665/pages-section-search.png?width=690&amp;height=155&amp;enlarge=0 690w, https://assets.getkirby.com/media/pages/docs/reference/panel/sections/pages/392afe3003-1717846665/pages-section-search.png?width=924&amp;height=208&amp;enlarge=0 924w, https://assets.getkirby.com/media/pages/docs/reference/panel/sections/pages/392afe3003-1717846665/pages-section-search.png?width=1380&amp;height=311&amp;enlarge=0 1380w, https://assets.getkirby.com/media/pages/docs/reference/panel/sections/pages/392afe3003-1717846665/pages-section-search.png?width=1776&amp;height=400&amp;enlarge=0 1848w" width="924"></a></figure>

Section search is disabled by default. You can use the `search` option to enable it.

```yaml
sections:
  drafts:
    type: pages
    search: true
```

(screencast: https://youtu.be/rC9Up05WVnI poster: youtube-bookmarks.jpg title: Build a bookmark tool text: An example how to build a nice overview with the table layout in the pages section showing all relevant columns.)