-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
/
pages.yaml
212 lines (192 loc) · 4.81 KB
/
pages.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
title: Pages
description: Manage your Grav Pages in Flex.
type: flex-objects
# Extends a page (blueprint gets overridden inside the object)
extends@:
type: default
context: blueprints://pages
#
# HIGHLY SPECIALIZED FLEX TYPE, AVOID USING PAGES AS BASE FOR YOUR OWN TYPE.
#
# Flex configuration
config:
# Administration Configuration (needs Flex Objects plugin)
admin:
# Admin router
router:
path: '/pages'
# Permissions
permissions:
# Primary permissions
admin.pages:
type: crudl
label: Pages
admin.configuration.pages:
type: default
label: Pages Configuration
# Admin menu
menu:
list:
route: '/pages'
title: PLUGIN_ADMIN.PAGES
icon: fa-file-text
authorize: ['admin.pages.list', 'admin.super']
priority: 5
# Admin template type (folder)
template: pages
# Allowed admin actions
actions:
list: true
create: true
read: true
update: true
delete: true
# List view
list:
# Fields shown in the list view
fields:
published:
width: 8
alias: header.published
visible:
width: 8
field:
label: Visible
type: toggle
menu:
link: edit
alias: header.menu
full_route:
field:
label: Route
type: text
link: edit
sort:
field: key
name:
width: 8
field:
label: Type
type: text
translations:
width: 8
field:
label: Translations
type: text
# updated_date:
# alias: header.update_date
# Extra options
options:
# Default number of records for pagination
per_page: 20
# Default ordering
order:
by: key
dir: asc
# TODO: not used yet
buttons:
back:
icon: reply
title: PLUGIN_ADMIN.BACK
add:
icon: plus
label: PLUGIN_ADMIN.ADD
edit:
title:
template: "{% if object.root %}Root <small>( <root> )</small>{% else %}{{ (form.value('header.title') ?? form.value('folder'))|e }} <small>( {{ (object.getRoute().toString(false) ?: '/')|e }} )</small>{% endif %}"
# TODO: not used yet
buttons:
back:
icon: reply
title: PLUGIN_ADMIN.BACK
preview:
icon: eye
title: PLUGIN_ADMIN.PREVIEW
add:
icon: plus
label: PLUGIN_ADMIN.ADD
copy:
icon: copy
label: PLUGIN_ADMIN.COPY
move:
icon: arrows
label: PLUGIN_ADMIN.MOVE
delete:
icon: close
label: PLUGIN_ADMIN.DELETE
save:
icon: check
label: PLUGIN_ADMIN.SAVE
# Preview View
preview:
enabled: true
# Configure view
configure:
authorize: 'admin.configuration.pages'
# Site Configuration
site:
# Hide from flex types
hidden: true
templates:
collection:
# Lookup for the template layout files for collections of objects
paths:
- 'flex/{TYPE}/collection/{LAYOUT}{EXT}'
object:
# Lookup for the template layout files for objects
paths:
- 'flex/{TYPE}/object/{LAYOUT}{EXT}'
defaults:
# Default template {TYPE}; overridden by filename of this blueprint if template folder exists
type: pages
# Default template {LAYOUT}; can be overridden in render calls (usually Twig in templates)
layout: default
# Default filters for frontend.
filter:
- withPublished
# Data Configuration
data:
object: 'Grav\Common\Flex\Types\Pages\PageObject'
collection: 'Grav\Common\Flex\Types\Pages\PageCollection'
index: 'Grav\Common\Flex\Types\Pages\PageIndex'
storage:
class: 'Grav\Common\Flex\Types\Pages\Storage\PageStorage'
options:
formatter:
class: 'Grav\Framework\File\Formatter\MarkdownFormatter'
folder: 'page://'
# Keep index file in filesystem to speed up lookups
indexed: true
# Set default ordering of the pages
ordering:
storage_key: ASC
search:
# Search options
options:
contains: 1
# Fields to be searched
fields:
- key
- slug
- menu
- title
blueprints:
configure:
fields:
import@:
type: configure/compat
context: blueprints://flex
# Regular form definition
form:
fields:
lang:
type: hidden
value: ''
tabs:
fields:
security:
type: tab
title: PLUGIN_ADMIN.SECURITY
import@:
type: partials/security
context: blueprints://pages