@mikulabc If you are using the Admin panel to create pages, the following might be a solution. If you create pages manually using an editor I would not know of any Grav solution.
Grav allows you to extend the blueprints used by Admin to generate pages. Have a look at the docs on Page Blueprints.
In the following example, a new section 'Access' with two new fields will be added to the bottom of tab 'Advanced'. The defaults are being set to 'true'. Every time a page is created using Admin panel, the two fields are added to the frontmatter of the page.
- Create file '/user/blueprints/pages/default.yaml
-
Add the following to the page:
title: Access
'@extends':
type: default
context: blueprints://pages
form:
fields:
tabs:
type: tabs
active: 1
fields:
advanced:
fields:
access:
type: section
title: Access
underline: true
fields:
header.access.site.login:
type: toggle
label: Site login
highlight: 1
default: 1
options:
1: PLUGIN_ADMIN.ENABLED
0: PLUGIN_ADMIN.DISABLED
validate:
type: bool
header.access.site.admin:
type: toggle
label: Site admin
highlight: 1
default: 1
options:
1: PLUGIN_ADMIN.ENABLED
0: PLUGIN_ADMIN.DISABLED
validate:
type: bool
Off course, you can place the section/fields somewhere else e.g another tab.
Hope this helps...