View
Control how collections are listed in the editor.
view only applies to collections.
It controls how the collection list is displayed.
Keys
| Key | Description |
|---|---|
fields |
Fields shown in the list, in order (e.g. ["title", "published", "author.name"]). |
primary |
Field used as the main label. Defaults to title if present. |
sort |
Fields available for sorting. |
search |
Fields indexed for search. |
default.search |
Default search query. |
default.sort |
Default sort field. |
default.order |
Values: asc, desc. |
layout |
Values: list, tree. |
node |
Tree node config, as a string or object. |
node.filename |
Node filename in tree mode. |
node.hideDirs |
Values: all, nodes, others. |
Examples
Basic list view
view:
fields: [title, published, date]
primary: title
sort: [date, title]
default:
sort: date
order: desc
Tree view
view:
layout: tree
node:
filename: index.md
hideDirs: others
fields: [title]
primary: title