Skip to content

Commit

Permalink
updated readme and various improvements
Browse files Browse the repository at this point in the history
  • Loading branch information
Robert van Lienden committed May 17, 2021
1 parent ec8df75 commit 375f386
Show file tree
Hide file tree
Showing 5 changed files with 40 additions and 51 deletions.
43 changes: 40 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,10 +30,47 @@ themes:

```
### TinyMCE Config
Follow Add the following steps to add Bulma headings in WYSYWIG editor:
Copy the code from `themes/silverstripe-bulma-dark-theme/TinyMCE.php` to `app/_config/_config.php` to
add correct formatting for headings and some other bulma elements.
- Add the following lines to your `app/_config/mysite.yml`:
```yaml
SilverStripe\Forms\HTMLEditor\TinyMCEConfig:
editor_css:
- 'themes/silverstripe-bulma-dark-theme/css/editor.css'
```

- Add the following code to `app/_config/_config.php`:
```php
use SilverStripe\Forms\HTMLEditor\TinyMCEConfig;
// .......
$formats = [
[ 'title' => 'Headings', 'items' => [
['title' => 'Heading 1', 'block' => 'h1', 'classes' => 'title is-1'],
['title' => 'Heading 2', 'block' => 'h2', 'classes' => 'title is-2'],
['title' => 'Heading 3', 'block' => 'h3', 'classes' => 'title is-1'],
['title' => 'Heading 4', 'block' => 'h4', 'classes' => 'title is-4'],
['title' => 'Heading 5', 'block' => 'h5', 'classes' => 'title is-5'],
['title' => 'Heading 6', 'block' => 'h6', 'classes' => 'title is-6'],
['title' => 'Heading 6', 'block' => 'h6', 'classes' => 'title is-6'],
[
'title' => 'Subtitle',
'selector' => 'p',
'classes' => 'title-sub',
],
]
],
];
TinyMCEConfig::get('cms')
->addButtonsToLine(2, 'styleselect')
->setOptions([
'importcss_append' => true,
'style_formats' => $formats,
])
->removeButtons('formatselect');
```

Now you got the Bulma-styles headings in the WYSIWYG editor!

## Developing

Expand Down
30 changes: 0 additions & 30 deletions TinyMCE.php

This file was deleted.

1 change: 0 additions & 1 deletion css/admin.css

This file was deleted.

1 change: 0 additions & 1 deletion css/vendors/bulma.css

This file was deleted.

16 changes: 0 additions & 16 deletions src/editor/admin.scss

This file was deleted.

0 comments on commit 375f386

Please sign in to comment.