This is a sub-issue of #1910624: [META] Introduce and complete configuration schemas in all of core.
Problem/motivation
#1866610: Introduce Kwalify-inspired schema format for configuration introduced the idea of config schema. The changelog leads to (hopefully extensive) documentation on the format at http://drupal.org/node/1905070. While there are little cleanups planned for the format overall, the current format is a result of months of back and forths, so it should be perfectly fine to apply it more widely to core.
Proposed solution
Create a configuration schema for editor module.
Schema in place
Schema not yet in place
editor.editor.*.yml
Sample (interesting) config file:
format: basic_html
editor: ckeditor
settings:
toolbar:
buttons:
-
- Bold
- Italic
- '|'
- Link
- Unlink
- '|'
- BulletedList
- NumberedList
- '|'
- Blockquote
- Image
- '|'
- Source
plugins:
stylescombo:
styles: ''
status: '1'
langcode: und
Comment | File | Size | Author |
---|---|---|---|
#8 | 1964648-editor-config-schema-8.patch | 1.72 KB | vijaycs85 |
#8 | 1964648-diff-5-8.txt | 1.52 KB | vijaycs85 |
#5 | 1964648-editor-config-schema-5.patch | 1.72 KB | vijaycs85 |
#1 | 1964648-editor-config-schema-1.patch | 1.34 KB | vijaycs85 |
#1 | 1964648-form.png | 42.28 KB | vijaycs85 |
Comments
Comment #0.0
vijaycs85Updating sample config.
Comment #1
vijaycs85Adding schema with config_inspector screenshots...
Comment #2
Wim LeersEditor module only controls the top-level keys: format, editor, settings, status and langcode.
Anything inside "settings" is Text Editor Plugin-specific. It'll be interesting to see whether it's even possible to express that :)
Comment #3
Gábor HojtsyWim: it is definitely possible to do that :) So those would be with ckeditor module then? Dynamic types are supported in schemas, views, image styles, etc. use this :)
Comment #4
Wim LeersYes, currently CKEditor is the only Text Editor Plugin. There's also UnicornEditor, but that's just a module for testing purposes.
And: cool :)
Comment #5
vijaycs85Updated schema get settings from CKeditor and CKeditor get plugin. Can see StylesCombo and Internal, but not sure how to use Internal to add its schema.
Comment #6
Gábor HojtsyNoticed this on a quick review:
Contact category is definitely not true :)
I did not cross-check with the data .yml, so cannot vouch for correctness of that.
Comment #7
Wim LeersMaybe "CKEditor settings" instead?
I think this should be "Rows".
The "buttons" key contains a sequence of rows, with each row containing a sequence of buttons, with each button being a string.
s/Styles combo/Styles dropdown/
(Assuming that we should be using UI labels.)
OR
s/Styles combo/stylescombo/
(Assuming that we should be using plugin names/identifiers.)
s/Style/List of styles/
(I know this seems counterintuitive, but classes are stored in a
h1.title|Title\np.callout|Callout\n
form.)"Text Editor" :)
(Or should it be plural? That's what
filter.schema.yml
has.)I think this should be just "Language", not "Default language"?
The language is *not* configurable through the UI, this is the language set by the Config Entity subsystem.
I looked at other
*.schema.yml
files, and the labels for this vary: "Langcode", "Language", "Default language". We should standardize on one.Comment #8
vijaycs85Thanks @Gábor Hojtsy and @Wim Leers for the review. Fixed labels and here is few comment.
1. s/Styles combo/Styles dropdown/ - We want to keep schema labels consistent with the UI. If there is no UI, we take our call. However found 'Styles dropdown' in config entity defition. So using it.
2. (Or should it be plural? That's what filter.schema.yml has.) - May be we need to fix filter :) as this is representing single filter and single editor this case.
3. I looked at other *.schema.yml files, and the labels for this vary: "Langcode", "Language", "Default language". We should standardize on one. - Agreed. We can stick with 'Language' where we can't be changed and 'Default language' where we can. This can be done in all schema once moved all in. #1971490: Standardize label of langcode field in schema files.
Comment #9
Gábor HojtsyI think its fine as "Default language" or "Language", contrib might provide a UI to change language even for config entities/files where it is not possible to change by default.
Comment #10
Wim LeersAwesome, thank you!
Comment #11
alexpottCommitted 24f5462 and pushed to 8.x. Thanks!
Comment #12
Gábor HojtsyThanks all!
Comment #13.0
(not verified) CreditAttribution: commentedUpdated issue summary.