pages.yaml 4.8 KB

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