Skip to content

Commit 4b2b767

Browse files
committed
Clarify/update Redactor settings
1 parent 0b63cde commit 4b2b767

File tree

1 file changed

+36
-15
lines changed

1 file changed

+36
-15
lines changed

content/collections/fieldtypes/redactor.md

Lines changed: 36 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,11 @@ image: 22318543-6610-45b9-b21b-d1bed3b2afe7
55
options:
66
-
77
name: settings
8-
type: array
8+
type: string
99
description: >
10-
An array of settings to be passed into
11-
the Redactor plugin. This should be a
12-
YAML version of the Javascript object
13-
you would use to initialize Redactor.
10+
The _name_ of the Redactor setting configuration you want to use.
11+
If you leave this blank, or specify a name that doesn't exist,
12+
Statamic will use the first set of settings in the list.
1413
id: 25d8be49-2300-42ac-90e4-92df42fc2906
1514
---
1615
## Data Structure {#data-structure}
@@ -22,14 +21,32 @@ quote: |
2221
<blockquote>I signed up for Second Life about a year ago. Back then, my life was so great that I literally wanted a second one. Absolutely everything was the same... except I could fly.</blockquote><p>– Dwight Schrute</p>
2322
```
2423

25-
This is fine, but keep it in mind if you're using it for your `content` field set to "markdown". Statamic parse the `content` as Markdown and any unintended text indentation will be converted to code blocks.
26-
27-
[redactor-docs]: https://imperavi.com/assets/pdf/redactor-documentation-10.pdf
24+
This is fine, but keep it in mind if you're using it for your `content` field and are using a markdown file.
25+
Statamic automatically parses the `content` field as Markdown within `md` files.
2826

2927

3028
## Redactor.js Configuration {#configuration}
3129

32-
You are able to customize all of the Redactor options. You can [view the full list of settings in the Redactor documentation][redactor-docs]
30+
You are able to set any number of predefined Redactor setting configurations. We give you two out of the box, but of
31+
course you are free to modify those and add more.
32+
33+
``` .language-yaml
34+
-
35+
name: Standard
36+
settings:
37+
buttons: [formatting, bold, italic, unorderedlist, orderedlist, html]
38+
-
39+
name: Basic
40+
settings:
41+
buttons: [bold, italic]
42+
```
43+
44+
Each item has a name, which is what you will see when configuring your fieldtype, and the settings themselves.
45+
46+
You can find these Redactor settings in `Configure > Settings > System` or within `site/settings/system.yaml`.
47+
48+
The `settings` value should be a YAML representation of the options object that will get passed into the Redactor jQuery
49+
plugin. You are able to customize all of the Redactor options. You can [view the full list of settings in the Redactor documentation][redactor-docs].
3350

3451
Any settings and options available to the plugin can be set here. For example, if the docs say to use the following configuration object:
3552

@@ -43,12 +60,16 @@ $('textarea').redactor({
4360
You would translate to YAML like so:
4461

4562
``` .language-yaml
46-
settings:
47-
formatting:
48-
- p
49-
- blockquote
50-
- h2
51-
minHeight: 300
63+
-
64+
name: My Redactor Settings
65+
settings:
66+
formatting:
67+
- p
68+
- blockquote
69+
- h2
70+
minHeight: 300
5271
```
5372

5473
*Note: Function type options (eg. callbacks) are not supported.*
74+
75+
[redactor-docs]: https://imperavi.com/assets/pdf/redactor-documentation-10.pdf

0 commit comments

Comments
 (0)