Customize CKeditor and remove h1 from formatting
Permalink
Hi! I like to remove h1 from the format-dropdown in CKeditor. From a SEO and Design perspective our editors should not use two h1 in the content. So removing this from the WYSIWYG editor would help a lot.
Does anyone now how to achieve this in concrete5?
In the documentation from CKeditor I found this description. But where can I do this safely in C5?
http://docs.ckeditor.com/#!/api/CKEDITOR.config-cfg-format_tags...
best Regards, Roland
Does anyone now how to achieve this in concrete5?
In the documentation from CKeditor I found this description. But where can I do this safely in C5?
http://docs.ckeditor.com/#!/api/CKEDITOR.config-cfg-format_tags...
best Regards, Roland
Thanks for your reply (and discussion in slack).
As a designer I have no chance to override this at the moment in a good way without tutorial.
But many thanks for checking this out.
best regards, Roland
As a designer I have no chance to override this at the moment in a good way without tutorial.
But many thanks for checking this out.
best regards, Roland
Hi,
In ./application/config/generated_overrides/site.php you can put :
return [
'sites' => [
'default' => [
'name' => 'YOUR_SITE',
'editor' => [
'ckeditor4' => [
'custom_config_options' => [
'format_tags' => 'p;h2;h3',
],
],
],
],
],
];
I write from the Controller of my package (see below), but you can write the part of the table manually in a site.php I think.
use Config;
Config::save('site.sites.default.editor.ckeditor4.custom_config_options.format_tags', 'p;h2;h3');
Regards
In ./application/config/generated_overrides/site.php you can put :
return [
'sites' => [
'default' => [
'name' => 'YOUR_SITE',
'editor' => [
'ckeditor4' => [
'custom_config_options' => [
'format_tags' => 'p;h2;h3',
],
],
],
],
],
];
I write from the Controller of my package (see below), but you can write the part of the table manually in a site.php I think.
use Config;
Config::save('site.sites.default.editor.ckeditor4.custom_config_options.format_tags', 'p;h2;h3');
Regards
Thanks, I found this on Google and this helped a lot !
Did you find a way to *add* a new tag or change a label ?
I need to add a <small> element. I managed to do it this way :
This works, except that the label is "Preformatted" instead of being "Legal" and this is confusing for editors.
Did you find a way to *add* a new tag or change a label ?
I need to add a <small> element. I managed to do it this way :
Config::save('site.sites.default.editor.ckeditor4.custom_config_options.format_tags', 'p;h2;h3;h4;pre'); Config::save('site.sites.default.editor.ckeditor4.custom_config_options.format_pre', [ 'element' => 'small', 'attributes' => ['class' => 'legal']]);
This works, except that the label is "Preformatted" instead of being "Legal" and this is confusing for editors.
Hi,
I never did it, but if I understand doc, attributes->class may not change label, but add the class="label" attributes on your small tag...
I think you must have a new tag to do it.
Regards
I never did it, but if I understand doc, attributes->class may not change label, but add the class="label" attributes on your small tag...
I think you must have a new tag to do it.
Regards
The config settings for CKEditor are in the CkeditorEditor class.
https://github.com/concrete5/concrete5/blob/develop/concrete/src/Edi...
I am not sure if this file can be overridden.