You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on May 20, 2023. It is now read-only.
Copy file name to clipboardExpand all lines: README.md
+8-3Lines changed: 8 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -3,24 +3,27 @@ This module adds a field and a data type that allows for Markdown editing in the
3
3
4
4
It is integrated with the [SimpleMDE Markdown Editor](https://github.com/NextStepWebs/simplemde-markdown-editor) for CMS editing (see "Editor limitations" below).
5
5
6
+
6
7
## Requirements
7
8
- SilverStripe 3.x
8
9
10
+
9
11
## Usage
10
12
Use the Markdown data type as your fields data type, then use the SimpleMDEEditor field in the CMS for editing.
@@ -39,6 +42,7 @@ class MyMarkdownPage extends Page
39
42
```
40
43
41
44
### .htaccess:
45
+
42
46
The JavaScript and CSS resources needed to show the editor is unfortunately installed in the `vendor` folder. By default, SilverStripe blocks all HTTP requests to it (note that we do not want to include the dependencies directly because we want Composer to handle those dependencies). In order to get this to work, we'll need to allow access to those resources.
43
47
44
48
Add the following line:
@@ -57,12 +61,13 @@ so that the `.htaccess` file would look similar to the following:
57
61
58
62
```
59
63
# Deny access to potentially sensitive files and folders
60
-
RewriteCond %{REQUEST_FILENAME} !\.(js|css)$
64
+
RewriteCond %{REQUEST_FILENAME} !\.(js|css)$
61
65
RewriteRule ^vendor(/|$) - [F,L,NC]
62
66
63
67
RewriteRule silverstripe-cache(/|$) - [F,L,NC]
64
68
RewriteRule composer\.(json|lock) - [F,L,NC]
65
69
```
66
70
67
71
## Editor limitations:
72
+
68
73
SimpleMDE has some nice features such as full-page editing/preview, as well as "Side by Side" editing [see demo](http://nextstepwebs.github.io/simplemde-markdown-editor/). Unfortunately this doesn't play nice with SilverStripe's CMS as the fullscreen elements are positioned statically. Rather than some ugly hacking, and until someone hopefully finds an elegant solution (pull requests please), fullscreen & side-by-side functionality has been hidden from the toolbar.
0 commit comments