Skip to content

Commit cef92b9

Browse files
authored
Merge pull request #7235 from umbraco/style-select
Added steps to add style select to RTE toolbar
2 parents 44dc27f + c67f97b commit cef92b9

File tree

4 files changed

+50
-27
lines changed

4 files changed

+50
-27
lines changed
Loading

15/umbraco-cms/fundamentals/backoffice/property-editors/built-in-umbraco-property-editors/rich-text-editor/style-menu.md

Lines changed: 25 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,30 @@
1-
# Style Menu
1+
# Style Select Menu
22

3-
A Style Menu is a configurable extension that adds a cascading menu to the toolbar for applying text styles and formatting.
3+
A Style Select Menu is a configurable extension that adds a cascading menu to the toolbar for applying text styles and formatting.
44

55
![Rich Text Editor cascading style menu](images/rte-tiptap-stylemenu.png)
66

77
{% hint style="info" %}
8-
Any custom stylesheets associated with the Rich Text Editor will not auto generate a style menu in the toolbar.
8+
Any custom stylesheets associated with the Rich Text Editor will not auto generate a style select menu in the toolbar.
99
{% endhint %}
1010

11-
### Creating a Style Menu
11+
## Adding Style Select to Rich Text Editor
1212

13-
In this article, you can find an example of how to set up a Style Menu using the package manifest file.
13+
To add Style Select to the Rich Text Editor:
14+
15+
1. Go to **Settings**.
16+
2. Navigate to **Data Types**.
17+
3. Select the relevant Data Type.
18+
4. Drag **Style Select** from **Available Actions** into the **Toolbar** section.
19+
5. Click **Save**.
20+
21+
Alternatively, while configuring an editor on a Document Type, you can drag **Style Select** from **Available Actions** into the **Toolbar** section.
22+
23+
![Adding Style Select to the Rich Text Editor](images/adding-style-select-to-toolbar.png)
24+
25+
## Creating a Style Select Menu
26+
27+
In this article, you can find an example of how to set up a Style Select Menu using the package manifest file.
1428

1529
{% code title="umbraco-package.json" %}
1630
```json
@@ -72,35 +86,32 @@ In this article, you can find an example of how to set up a Style Menu using the
7286
```
7387
{% endcode %}
7488

75-
76-
The `items` property defines the structure of the style menu. Each menu item has the following options:
89+
The `items` property defines the structure of the style select menu. Each menu item has the following options:
7790

7891
- `label`: _(required)_ The label of the menu item. This supports localization keys.
7992
- `appearance`: This defines the appearance of the menu item. The value has 2 optional properties:
8093
- `icon`: To prefix an icon to the menu item.
8194
- `style`: To apply CSS rules to the menu item.
82-
- `data`: To configure the function of the style menu item. The value has 3 optional properties:
95+
- `data`: To configure the function of the style select menu item. The value has 3 optional properties:
8396
- `tag`: A [supported HTML tag](#supported-html-tags) name. This will be applied to the selected text.
8497
- `class`: Applies a class attribute with the defined class name to the containing tag of the selected text.
8598
- `id`: Applies an ID attribute with the defined ID value to the containing tag of the selected text.
8699
- `separatorAfter`: When `true`, it will add a line separator after the menu item.
87100
- `items`: To enable a cascading menu, an array of nested menu items may be added.
88101

102+
Once configured, all custom style select menus will appear in the Rich Text Editor toolbar options, as described in the [Rich Text Editor Configuration](configuration.md) article.
89103

90-
Once configured, all custom style menus will appear in the Rich Text Editor toolbar options, as described in the [Rich Text Editor Configuration](configuration.md) article.
91-
92-
93-
#### Supported HTML tags
104+
### Supported HTML tags
94105

95-
Since the Tiptap has a strict rich-text schema, only supported HTML tags can be used in the style menu, _(arbitrary markup will be excluded)._ The following HTML tag names are supported:
106+
Due to Tiptap’s strict rich-text schema, only supported HTML tags are allowed in the style select menu, _(arbitrary markup will be excluded)._ The following HTML tag names are supported:
96107

97108
- `h1`
98109
- `h2`
99110
- `h3`
100111
- `h4`
101112
- `h5`
102113
- `h6`
103-
- `p`
114+
- `p`
104115
- `blockquote`
105116
- `code`
106117
- `codeBlock`
Loading

16/umbraco-cms/fundamentals/backoffice/property-editors/built-in-umbraco-property-editors/rich-text-editor/style-menu.md

Lines changed: 25 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,30 @@
1-
# Style Menu
1+
# Style Select Menu
22

3-
A Style Menu is a configurable extension that adds a cascading menu to the toolbar for applying text styles and formatting.
3+
A Style Select Menu is a configurable extension that adds a cascading menu to the toolbar for applying text styles and formatting.
44

55
![Rich Text Editor cascading style menu](images/rte-tiptap-stylemenu.png)
66

77
{% hint style="info" %}
8-
Any custom stylesheets associated with the Rich Text Editor will not auto generate a style menu in the toolbar.
8+
Any custom stylesheets associated with the Rich Text Editor will not auto generate a style select menu in the toolbar.
99
{% endhint %}
1010

11-
### Creating a Style Menu
11+
## Adding Style Select to Rich Text Editor
1212

13-
In this article, you can find an example of how to set up a Style Menu using the package manifest file.
13+
To add Style Select to the Rich Text Editor:
14+
15+
1. Go to **Settings**.
16+
2. Navigate to **Data Types**.
17+
3. Select the relevant Data Type.
18+
4. Drag **Style Select** from **Available Actions** into the **Toolbar** section.
19+
5. Click **Save**.
20+
21+
Alternatively, while configuring an editor on a Document Type, you can drag **Style Select** from **Available Actions** into the **Toolbar** section.
22+
23+
![Adding Style Select to the Rich Text Editor](images/adding-style-select-to-toolbar.png)
24+
25+
## Creating a Style Select Menu
26+
27+
In this article, you can find an example of how to set up a Style Select Menu using the package manifest file.
1428

1529
{% code title="umbraco-package.json" %}
1630
```json
@@ -72,34 +86,32 @@ In this article, you can find an example of how to set up a Style Menu using the
7286
```
7387
{% endcode %}
7488

75-
76-
The `items` property defines the structure of the style menu. Each menu item has the following options:
89+
The `items` property defines the structure of the style select menu. Each menu item has the following options:
7790

7891
- `label`: _(required)_ The label of the menu item. This supports localization keys.
7992
- `appearance`: This defines the appearance of the menu item. The value has 2 optional properties:
8093
- `icon`: To prefix an icon to the menu item.
8194
- `style`: To apply CSS rules to the menu item.
82-
- `data`: To configure the function of the style menu item. The value has 3 optional properties:
95+
- `data`: To configure the function of the style select menu item. The value has 3 optional properties:
8396
- `tag`: A [supported HTML tag](#supported-html-tags) name. This will be applied to the selected text.
8497
- `class`: Applies a class attribute with the defined class name to the containing tag of the selected text.
8598
- `id`: Applies an ID attribute with the defined ID value to the containing tag of the selected text.
8699
- `separatorAfter`: When `true`, it will add a line separator after the menu item.
87100
- `items`: To enable a cascading menu, an array of nested menu items may be added.
88101

102+
Once configured, all custom style select menus will appear in the Rich Text Editor toolbar options, as described in the [Rich Text Editor Configuration](configuration.md) article.
89103

90-
Once configured, all custom style menus will appear in the Rich Text Editor toolbar options, as described in the [Rich Text Editor Configuration](configuration.md) article.
91-
104+
### Supported HTML tags
92105

93-
#### Supported HTML tags
106+
Due to Tiptap’s strict rich-text schema, only supported HTML tags are allowed in the style select menu, _(arbitrary markup will be excluded)._ The following HTML tag names are supported:
94107

95-
Since the Tiptap has a strict rich-text schema, only supported HTML tags can be used in the style menu, _(arbitrary markup will be excluded)._ The following HTML tag names are supported:
96108
- `h1`
97109
- `h2`
98110
- `h3`
99111
- `h4`
100112
- `h5`
101113
- `h6`
102-
- `p`
114+
- `p`
103115
- `blockquote`
104116
- `code`
105117
- `codeBlock`

0 commit comments

Comments
 (0)