@@ -3,7 +3,7 @@ title: Content view
3
3
slug : content-view
4
4
description : null
5
5
date : 2022-11-28T14:55:04.221Z
6
- lastmod : 2023-10-06T13:36:12.765Z
6
+ lastmod : 2024-02-22T10:46:27.387Z
7
7
weight : 300.1
8
8
---
9
9
@@ -55,21 +55,91 @@ If you want to use other statuses, you can do so by specifying your own draft fi
55
55
56
56
![ Draft filters] [ 04 ]
57
57
58
- ## Supported filters
58
+ ## Filters
59
59
60
+ By default, the content view will show all your pages, but you can filter them by using the following
61
+ filter:
62
+
63
+ - Content folder (when you have multiple registered)
60
64
- Tag filter
61
65
- Category filter
62
- - Content folder (when you have multiple registered)
63
66
64
- ## Supported sorting
67
+ You can change the default filters, or configure your own by updating the ` frontMatter.content.filters `
68
+ setting.
69
+
70
+ ### Configure filters
71
+
72
+ The default filter configuration is as follows:
73
+
74
+ ``` json {{ "title": "Default content filters configuration" }}
75
+ {
76
+ "frontMatter.content.filters" : [
77
+ " contentFolders" ,
78
+ " tags" ,
79
+ " categories" ,
80
+ ]
81
+ }
82
+ ```
83
+
84
+ You can change the default filters, or configure your own by updating the ` frontMatter.content.filters `
85
+ setting as follows:
86
+
87
+ ``` json {{ "title": "Example of adding custom filters" }}
88
+ {
89
+ "frontMatter.content.filters" : [
90
+ " contentFolders" ,
91
+ " tags" ,
92
+ {
93
+ "title" : " My custom filter" ,
94
+ "name" : " field-name" ,
95
+ }
96
+ ]
97
+ }
98
+ ```
99
+
100
+ > ** Info** : The ` name ` property should be the name of the front matter field you want to filter by.
101
+
102
+ ## Sorting
103
+
104
+ By default, the content is sorted by the following options:
65
105
66
106
- Last modified
67
107
- Filename (asc/desc)
68
108
69
- > ** Info** : You can define custom sorting options by specifying these within the
70
- > [ frontMatter.content.sorting] [ 05 ] setting.
109
+ You can change the sorting options by specifying the ` frontMatter.content.sorting ` setting. This
110
+ setting allows you to define the sorting options for the content view.
111
+
112
+ ### Configure sorting options
71
113
72
- You are also able to define your default sorting options by setting the
114
+ | Property | Description | Default |
115
+ | --- | --- | --- |
116
+ | ` title ` | The title of the sorting option | ` "" ` |
117
+ | ` name ` | The name of the field to sort by (needs to be present in your content its front matter) | ` "" ` |
118
+ | ` order ` | The order of the sorting (ascending or descending). Option values to use: ` asc ` or ` desc ` . | ` "" ` |
119
+ | ` type ` | The type of field value. Option values to use: ` string ` , ` date ` , and ` number ` . | ` "" ` |
120
+
121
+ ``` json {{ "title": "Example of adding custom sorting options" }}
122
+ {
123
+ "frontMatter.content.sorting" : [
124
+ {
125
+ "title" : " Date (asc)" ,
126
+ "name" : " date" ,
127
+ "order" : " asc" ,
128
+ "type" : " date"
129
+ },
130
+ {
131
+ "title" : " Date (desc)" ,
132
+ "name" : " date" ,
133
+ "order" : " desc" ,
134
+ "type" : " date"
135
+ }
136
+ ]
137
+ }
138
+ ```
139
+
140
+ ### Default sorting
141
+
142
+ To define your default sorting options by setting the
73
143
` frontMatter.content.defaultSorting ` setting for the content view, and the
74
144
` frontMatter.media.defaultSorting ` setting for the media view.
75
145
@@ -98,5 +168,4 @@ of the content view. This will allow you to quickly access.
98
168
[ 02 ] : /releases/v7.1.0/draft-filters.png
99
169
[ 03 ] : /docs/content-creation/fields#draft
100
170
[ 04 ] : /releases/v5.3.0/draft-status.png
101
- [ 05 ] : /docs/settings/overview#frontmatter.content.sorting
102
171
[ 06 ] : /docs/experimental/ui-extensibility#registering-a-custom-ui-extension
0 commit comments