Skip to content

This Umbraco package overrides the default Umbraco preview button and lets you configure an alternative preview url.

License

Notifications You must be signed in to change notification settings

jdpnielsen/Our.Umbraco.HeadlessPreview

 
 

Repository files navigation

CI-CD NuGet PRs Welcome

Our.Umbraco.HeadlessPreview

This package overrides the default Umbraco preview button and lets you configure an alternative preview url.

Installation

Install the NuGet package to get started.

Install the NuGet package

With .NET CLI

dotnet add package Our.Umbraco.HeadlessPreview --version <version>

Using the Package Manager

Install-Package Our.Umbraco.HeadlessPreview -Version <version>

Configuration

The package can be configured using the appsetings.json file or using the UI which will save the configuration in the database.

Setting Default value Description
TemplateUrl `` The URL used for preview. It can contain dynamic placeholder values to support different types of URL's.

Typically used template URL are:

UI

If you just have a single environment it's easy to just configure the plugin directly from the Umbraco Backoffice in the Settings section.

Configuration

appsettings.json

This is typically the preferred way if you have a multi environment setup as you can use environment specific settings.

"HeadlessPreview": {
    "TemplateUrl": "https://mysite.com/api/preview?slug={slug}&secret=mySecret"
}

Placeholders

Placeholders are predefined keys enclosed in curly braces that you can use in your tempalte URL. Placeholders are automatically replaced with real values based on the page you are previewing.

Placeholder Description
{hostname} The hostname added on nearest ancestor node or self with the right culture in Umbraco. If multiple hostname has same culture it takes the first.
{slug} The relative path of the page being previewed.

Changelog

See new features, fixes and breaking changes for each Release.

Contributing

Pull requests are very welcome.

Please fork this repository and make a PR when you are ready.

Otherwise you are welcome to open an Issue in our issue tracker.

License

Our.Umbraco.HeadlessPreview is MIT licensed

About

This Umbraco package overrides the default Umbraco preview button and lets you configure an alternative preview url.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • C# 59.7%
  • JavaScript 24.4%
  • HTML 10.6%
  • PowerShell 3.6%
  • CSS 1.7%