Skip to content
Grav 2.1 is out: every page speaks Markdown. Read the announcement →

Page header access groups

Started by Guillaume Storchi 6 years ago · 0 replies · 590 views
6 years ago

Hi,
I am looking for a way to add this header frontmatter from page admin advanced tab

access:
site:
login: true
group1: true
group2: true

as groups are array keys here, it is a problem to add enable disable a group ...

I modified blueprints/docs.yaml

title: Docs
'@extends':
type: default
context: blueprints://pages

form:
fields:
tabs:
type: tabs
active: 1
fields:
advanced:
fields:
overrides:
fields:.
header.access.site.login:
type: toggle.
label: PLUGIN_ADMIN.SITE_ACCESS
help: PLUGIN_ADMIN.ACCESS_HELP
toggleable: true
config-default@: system.pages.access
default: true.
options:
1: PLUGIN_ADMIN.ENABLED
0: PLUGIN_ADMIN.DISABLED
validate:
type: bool

YAML
            header.access.site:                                             
              name: groups                                                  
              type: select                                                  
              multiple: true                                                
              toggleable: true                                              
              label: PLUGIN_ADMIN.GROUPS                                    
              help: ''                                                      
              data-options@: '\AdminAddonUserManager\Group::groupNames'        
              validate:                                                     
                type: commalist

Suggested topics

Topic Participants Replies Views Activity
General · by jeremycherfas, 4 days ago
2 86 15 hours ago
General · by Old Man Umby, 2 days ago
1 60 2 days ago
General · by Sebastian, 4 days ago
1 81 4 days ago
General · by Andy Miller, 2 weeks ago
0 215 2 weeks ago
General · by ready-4-IT, 6 months ago
1 716 3 weeks ago