dezbat
April 5, 2018, 8:47pm
1
I have a projectpage.yaml file, extending ‘default’ — and I want to force new project pages to be set to visible ‘disabled’ by default when adding new pages with projectpage template…
trying with this structure, but no dice…
form:
fields:
tabs:
type: tabs
active: 1
fields:
advanced:
fields:
overrides:
fields:
header.visible:
default: false
header.debugger:
default: false
paul
April 6, 2018, 9:34am
2
You might have to set default to 1 or to redefine the whole field, so something like this should work:
title: MyTitle
'@extends':
type: default
context: blueprints://pages
form:
fields:
tabs:
fields:
advanced:
fields:
overrides:
fields:
header.visible:
type: toggle
toggleable: true
label: PLUGIN_ADMIN.VISIBLE
help: PLUGIN_ADMIN.VISIBLE_HELP
highlight: 1
default: 0
options:
1: PLUGIN_ADMIN.ENABLED
0: PLUGIN_ADMIN.DISABLED
validate:
type: bool
This yaml is hard to read for me, because of these inconvenient indentation
dezbat
April 6, 2018, 7:07pm
4
hi @paul - -thanks as ever - -so far it gives me this craziness! Having a tinker now…
dezbat
April 6, 2018, 7:19pm
5
Still stumped!
This is my current .yaml… the custom.Subtitle and the folder.numeric prefix are working fine, but not visibility ‘off’ setting…
Out of interest, where is the documentation that would tell me how to define / find labels like this label: PLUGIN_ADMIN.VISIBLE
//
title: projectpage
@extends:
type: default
context: blueprints://pages
form:
fields:
tabs:
type: tabs
active: 1
fields:
content:
type: tab
#
# Add your custom fields here.
# These fields will be available in the page's Content tab
# inside the Admin Panel.
#
fields:
#
# subtitle text field
#
header.custom.Subtitle:
type: text
label: Subtitle
form:
fields:
tabs:
fields:
advanced:
fields:
overrides:
fields:
header.visible:
type: toggle
label: PLUGIN_ADMIN.VISIBLE
help: PLUGIN_ADMIN.VISIBLE_HELP
highlight: 1
default: 1
options:
1: PLUGIN_ADMIN.DISABLED
0: PLUGIN_ADMIN.ENABLED
validate:
type: bool
form:
fields:
tabs:
fields:
advanced:
fields:
columns:
fields:
column2:
fields:
ordering:
type: toggle
label: PLUGIN_ADMIN.FOLDER_NUMERIC_PREFIX
help: PLUGIN_ADMIN.FOLDER_NUMERIC_PREFIX_HELP
highlight: 1
default: 1
options:
1: PLUGIN_ADMIN.ENABLED
0: PLUGIN_ADMIN.DISABLED
validate:
type: bool
dezbat
April 6, 2018, 10:36pm
6
Sorry! learning how to do this…