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
Copy file name to clipboardExpand all lines: 17/umbraco-cms/reference/content-delivery-api/additional-preview-environments-support.md
+108-9Lines changed: 108 additions & 9 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -5,21 +5,120 @@ description: >-
5
5
6
6
# Additional preview environments support
7
7
8
-
{% hint style="warning" %}
9
-
The original contents of this article, explaining how to change the backoffice UI, does not apply anymore to Umbraco 15 and above and has been removed.
10
-
The way to achieve this beyond Umbraco 14 is to create and register an [Extension](../../customizing/extending-overview) to modify the backoffice UI preview button.
11
-
{% endhint %}
12
-
13
-
With Umbraco, you can save and preview draft content before going live. The preview feature allows you to visualize how a page will look like once it is published, directly from within the backoffice. This is also possible for the Content Delivery API data. You can extend the preview functionality in the backoffice by configuring external preview URLs for client libraries consuming the Content Delivery API.
8
+
With Umbraco, you can save and preview draft content before going live. The preview feature allows you to visualize how a page will look once it is published, directly from within the backoffice. This is also possible for the Content Delivery API data. You can extend the preview functionality in the backoffice by configuring external preview URLs for client libraries consuming the Content Delivery API.
14
9
15
10
{% hint style="info" %}
16
-
To get introduced to the preview functionality in the Content Delivery API, please refer to the [Preview concept](https://docs.umbraco.com/umbraco-cms/reference/content-delivery-api#preview) section.
11
+
To learn more about the preview functionality in the Content Delivery API, see the [Preview concept](https://docs.umbraco.com/umbraco-cms/reference/content-delivery-api#preview) section.
17
12
{% endhint %}
18
13
14
+
Generating external preview URLs for the backoffice requires implementation on both the client and server sides.
15
+
16
+
## Server-side implementation
17
+
18
+
On the server-side, you'll need a custom `IUrlProvider` implementation. This is responsible for generating the preview URL for a given piece of content.
19
+
20
+
An external preview environment likely requires some kind of authentication to allow preview. The URL provider should perform this as well.
21
+
22
+
Here's an example of what a URL provider could look like:
Support for configuring additional preview environments in the Content Delivery API was introduced in version 12.3.
85
+
You can read more about extensions in the [Extending the Umbraco Backoffice](https://docs.umbraco.com/welcome/getting-started/developing-websites-with-umbraco/extending-the-umbraco-backoffice) article.
This extension works with the URL provider above because the `urlProviderAlias` of the extension matches the `Alias` of the URL provider.
113
+
114
+
Save the extension as `umbraco-package.json` in a folder under `App_Plugins` and (re)start the site. The result is a new preview option in a pop-up over the "Save and preview" button:
115
+
116
+

117
+
23
118
{% hint style="info" %}
24
-
An upcoming release of Umbraco will allow users to configure custom preview URLs directly in the backoffice.
119
+
The default "Save and preview" button is also an extension of this type.
120
+
121
+
In other words, multiple preview options can co-exist. If you have multiple external environments, you can create preview options for all of them.
122
+
123
+
The extension `weight` determines the order of appearance. A `weight` above 100 will swap the default preview option with the custom one.
0 commit comments