Problem/Motivation
Provide config schema.
Or config ignore it.
| Comment | File | Size | Author |
|---|---|---|---|
| #3 | Capture d’écran de 2023-03-20 17-44-29.png | 37.08 KB | grimreaper |
| #3 | Capture d’écran de 2023-03-20 17-43-46.png | 123.77 KB | grimreaper |
Issue fork layout_options-3348168
Show commands
Start within a Git clone of the project using the version control instructions.
Or, if you do not have SSH keys set up on git.drupalcode.org:
Comments
Comment #2
grimreaperComment #3
grimreaperRegarding the configuration structure:
It should be at each layout plugin using Layout Options to declare its own config schema, something like:
It is not possible to try to generate it dynamically because of the core issue #3070463: Allow adding dynamic configuration schema:
I started something like:
Also the structure of the aved configuration depends its value, multi true or false, see screenshot:
So the dynamic declaration for one layout would require to instanciate the LayoutOptions plugin, parse the layout options declaration for this layout (which logic is in the LayoutOptions plugin and not in the LayoutOptionPluginManager), see the available options and generate the config schema accordingly.
Currently, I will try to provide some base schema type that will be usable by contrib or custom layouts.
And I need to check for layout_options_ui.
Also no need to provide config schema per layout options plugins because all of them save strings.
Comment #6
grimreaperComment #8
anybody@Grimreaper thanks! We just ran into this in two of our modules using .layout_options.yml's.
I think it might make sense to add the best practices and an example of a layout_options.yml and the schema to create for this to the layout_options docs?
Perhaps also a note on the module page might make sense?
Especially because "false" is true in PHP, this can be really risky for boolean values :D