Skip to content
Grav 2.0 is officially stable. Read the announcement →

Community guidelines

Please keep discussions civil and on-topic. Repeated violations may lead to a temporary ban.

General

Page header access groups

Started by Guillaume Storchi 6 years ago · 0 replies · 385 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 Jerry Hunt, 4 days ago
2 82 11 hours ago
General · by pamtbaau, 16 hours ago
1 53 16 hours ago
General · by Andy Miller, 1 day ago
0 45 1 day ago
General · by Marcel, 12 months ago
6 347 5 days ago
General · by Duc , 5 days ago
3 41 5 days ago