mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-08-25 20:15:44 +02:00
# Conflicts: # admin/javascript/lang/cs.js # admin/javascript/lang/de.js # admin/javascript/lang/eo.js # admin/javascript/lang/es.js # admin/javascript/lang/fa_IR.js # admin/javascript/lang/fi.js # admin/javascript/lang/fr.js # admin/javascript/lang/id.js # admin/javascript/lang/id_ID.js # admin/javascript/lang/it.js # admin/javascript/lang/ja.js # admin/javascript/lang/lt.js # admin/javascript/lang/mi.js # admin/javascript/lang/nb.js # admin/javascript/lang/nl.js # admin/javascript/lang/pl.js # admin/javascript/lang/ro.js # admin/javascript/lang/ru.js # admin/javascript/lang/sk.js # admin/javascript/lang/sl.js # admin/javascript/lang/sr.js # admin/javascript/lang/sr@latin.js # admin/javascript/lang/sr_RS.js # admin/javascript/lang/sr_RS@latin.js # admin/javascript/lang/src/cs.js # admin/javascript/lang/src/de.js # admin/javascript/lang/src/eo.js # admin/javascript/lang/src/es.js # admin/javascript/lang/src/fa_IR.js # admin/javascript/lang/src/fi.js # admin/javascript/lang/src/fr.js # admin/javascript/lang/src/id.js # admin/javascript/lang/src/id_ID.js # admin/javascript/lang/src/it.js # admin/javascript/lang/src/ja.js # admin/javascript/lang/src/lt.js # admin/javascript/lang/src/mi.js # admin/javascript/lang/src/nb.js # admin/javascript/lang/src/nl.js # admin/javascript/lang/src/pl.js # admin/javascript/lang/src/ro.js # admin/javascript/lang/src/ru.js # admin/javascript/lang/src/sk.js # admin/javascript/lang/src/sl.js # admin/javascript/lang/src/sr.js # admin/javascript/lang/src/sr@latin.js # admin/javascript/lang/src/sr_RS.js # admin/javascript/lang/src/sr_RS@latin.js # admin/javascript/lang/src/sv.js # admin/javascript/lang/src/zh.js # admin/javascript/lang/sv.js # admin/javascript/lang/zh.js # javascript/lang/fa_IR.js # javascript/lang/src/fa_IR.js
34 lines
1.0 KiB
Markdown
34 lines
1.0 KiB
Markdown
title: WYSIWYG Styles
|
|
summary: Add custom CSS properties to the rich-text editor.
|
|
|
|
# WYSIWYG Styles
|
|
|
|
SilverStripe lets you customise the style of content in the CMS. This is done by setting up a CSS file called
|
|
`editor.css` in either your theme or in your `mysite` folder. This is set through
|
|
|
|
:::php
|
|
HtmlEditorConfig::get('cms')->setOption('content_css', project() . '/css/editor.css');
|
|
|
|
Will load the `mysite/css/editor.css` file.
|
|
|
|
If using this config option in `mysite/_config.php`, you will have to instead call:
|
|
|
|
:::php
|
|
HtmlEditorConfig::get('cms')->setOption('content_css', project() . '/css/editor.css');
|
|
|
|
Any CSS classes within this file will be automatically added to the `WYSIWYG` editors 'style' dropdown. For instance, to
|
|
add the color 'red' as an option within the `WYSIWYG` add the following to the `editor.css`
|
|
|
|
:::css
|
|
.red {
|
|
color: red;
|
|
}
|
|
|
|
<div class="notice" markdown="1">
|
|
After you have defined the `editor.css` make sure you clear your SilverStripe cache for it to take effect.
|
|
</div>
|
|
|
|
## API Documentation
|
|
|
|
* [api:HtmlEditorConfig]
|