|
1 | 1 | # SimpleMDE Editor & Markdown for SilverStripe 3 |
2 | | -This module adds a field and a data type that allows for Markdown editing in the CMS, and HTML template rendering |
3 | | -using the Github Flavoured Markdown parser [Parsedown](http://parsedown.org/). |
| 2 | +This module adds a field and a data type that allows for Markdown editing in the CMS, and HTML template rendering using the Github Flavoured Markdown parser [Parsedown](http://parsedown.org/). |
4 | 3 |
|
5 | | -It is integrated with the [SimpleMDE Markdown Editor](https://github.com/NextStepWebs/simplemde-markdown-editor) |
6 | | -for CMS editing (see "Editor limitations" below). |
| 4 | +It is integrated with the [SimpleMDE Markdown Editor](https://github.com/NextStepWebs/simplemde-markdown-editor) for CMS editing (see "Editor limitations" below). |
7 | 5 |
|
8 | 6 | ## Requirements |
9 | 7 | - SilverStripe 3.x |
@@ -41,35 +39,30 @@ class MyMarkdownPage extends Page |
41 | 39 | ``` |
42 | 40 |
|
43 | 41 | ### .htaccess: |
44 | | - |
45 | | -The JavaScript and CSS resources needed to show the editor is unfortunately installed in the `vendor` folder. By |
46 | | -default, SilverStripe blocks all HTTP requests to it (note that we do not want to include the dependencies directly |
47 | | -because we want Composer to handle those dependencies). In order to get this to work, we'll need to allow access to |
48 | | -those resources. |
| 42 | +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. |
49 | 43 |
|
50 | 44 | Add the following line: |
| 45 | + |
51 | 46 | ``` |
52 | | - RewriteCond %{REQUEST_FILENAME} !\.(js|css)$ |
| 47 | +RewriteCond %{REQUEST_FILENAME} !\.(js|css)$ |
53 | 48 | ``` |
| 49 | + |
54 | 50 | above this line: |
| 51 | + |
55 | 52 | ``` |
56 | | - RewriteRule ^vendor(/|$) - [F,L,NC] |
| 53 | +RewriteRule ^vendor(/|$) - [F,L,NC] |
57 | 54 | ``` |
58 | | -So that the `.htaccess` file would look similar to the following: |
| 55 | + |
| 56 | +so that the `.htaccess` file would look similar to the following: |
| 57 | + |
59 | 58 | ``` |
60 | | -... |
61 | | - # Deny access to potentially sensitive files and folders |
62 | | - RewriteCond %{REQUEST_FILENAME} !\.(js|css)$ |
63 | | - RewriteRule ^vendor(/|$) - [F,L,NC] |
64 | | -
|
65 | | - RewriteRule silverstripe-cache(/|$) - [F,L,NC] |
66 | | - RewriteRule composer\.(json|lock) - [F,L,NC] |
67 | | -... |
| 59 | +# Deny access to potentially sensitive files and folders |
| 60 | +RewriteCond %{REQUEST_FILENAME} !\.(js|css)$ |
| 61 | +RewriteRule ^vendor(/|$) - [F,L,NC] |
| 62 | +
|
| 63 | +RewriteRule silverstripe-cache(/|$) - [F,L,NC] |
| 64 | +RewriteRule composer\.(json|lock) - [F,L,NC] |
68 | 65 | ``` |
69 | 66 |
|
70 | 67 | ## Editor limitations: |
71 | | -SimpleMDE has some nice features such as full-page editing/preview, as well as "Side by Side" editing |
72 | | -[see demo](http://nextstepwebs.github.io/simplemde-markdown-editor/). Unfortunately this doesn't play nice with |
73 | | -SilverStripe's CMS as the fullscreen elements are positioned statically. Rather than some ugly hacking, and until |
74 | | -someone hopefully finds an elegant solution (pull requests please), fullscreen & side-by-side functionality has been |
75 | | -hidden from the toolbar. |
| 68 | +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