Adding Sidebar Buttons
Adding shortcut buttons to the sidebar, linking to on-site and external content
New Feature
You can add custom sidebar buttons that perform the following:
- Navigate to a specific page in your website. This is especially useful for utility pages that are available to content editors but not included in the production build, e.g. site configuration, 3rd-party tool settings, a style guide page, etc.
- A shortcut to an external URL, e.g. your live site which you host, or related tools that used by the content team.
- Open a specific content item for editing, either by its content ID or by its model name.
Adding buttons
sidebarButtons
Holds an array of one or more objects, each representing one button. Here's an example showing all button types:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
Available icons
The following icons are available:
- style
- add-new
- add-new-gear
- analytics
- external-link
- global-objects
- insights
- personalization
- search-settings
- seo
- tools
- user-management
Troubleshooting
In case a button does not work as expected, check the following:
- The
type
is set to one of the supported values (see above) - If using
type: "model"
, themodelName
value must be set to exactly the model's name in the CMS. It is common for CMS's to have both a display name and a fixed identifier for models. The latter is what you need, and it is typically case-sensitive. - If using
type: "document"
, ensure thedocumentId
is in exactly the same format as you're using for annotations. - For interal links (
type: link
), theurl
must be set to a relative URL.
Deprecated properties
styleObjectModelName
This property sets the model name of a content item storing the site's global styles.
If set to a valid model name, a button will appear in the sidebar, labeled "Global styles". When clicked, the visual editor will look for a content item of that model name and open it for editing. The current page is not changed, so that you can edit styles and see the effect of your changes on whatever page you have open.
While this property is still supported, you can now achieve similar functionality by defining a sidebar button:
1
2
3
4
5
6
7
8
9
10
11
1
2
3
4