WiredViews.Xperience.PageBuilderModeTagHelper
2.0.0
Prefix Reserved
dotnet add package WiredViews.Xperience.PageBuilderModeTagHelper --version 2.0.0
NuGet\Install-Package WiredViews.Xperience.PageBuilderModeTagHelper -Version 2.0.0
<PackageReference Include="WiredViews.Xperience.PageBuilderModeTagHelper" Version="2.0.0" />
paket add WiredViews.Xperience.PageBuilderModeTagHelper --version 2.0.0
#r "nuget: WiredViews.Xperience.PageBuilderModeTagHelper, 2.0.0"
// Install WiredViews.Xperience.PageBuilderModeTagHelper as a Cake Addin #addin nuget:?package=WiredViews.Xperience.PageBuilderModeTagHelper&version=2.0.0 // Install WiredViews.Xperience.PageBuilderModeTagHelper as a Cake Tool #tool nuget:?package=WiredViews.Xperience.PageBuilderModeTagHelper&version=2.0.0
Xperience Page Builder Mode Tag Helper
This library provides an ASP.NET Core Tag Helper for Kentico Xperience 13.0 that adds to the existing set.
Dependencies
This package is compatible with ASP.NET Core 3.1 → ASP.NET Core 5 and is designed to be used with the Xperience 13.0 Content Delivery (MVC) application running on ASP.NET Core.
How to Use?
First, install the NuGet package in your ASP.NET Core project
dotnet add package WiredViews.Xperience.PageBuilderModeTagHelper
Add the required types to the DI container in your
Startup.cs
filepublic void ConfigureServices(IServiceCollection services) { services.AddSingleton<IPageBuilderContext, XperiencePageBuilderContext>(); }
Include the tag builder namespace in the
~/Views/_ViewImports.cshtml
@addTagHelper *, Xperience.PageBuilderModeTagHelper
Use the tag helper in your Razor views
<page-builder-mode exclude="Live"> <h1>Hello!</h1> </page-builder-mode> <page-builder-mode include="LivePreview, Edit"> <h1>Hello!</h1> </page-builder-mode>
You can also use the
IPageBuilderContext
as a constructor dependency elsewhere in your application to more easily determine the state of the current request, without having to useIHttpContextAccessor
and all the Kentico Xperience extension methods:public class ProductsController { private readonly IPageBuilderContext context; public ProductsController(IPageBuilderContext context) { this.context = context ?? throw new ArgumentNullException(nameof(context)); } public ActionResult Index() { if (context.IsEditMode) { // ... } if (context.IsLivePreviewMode) { // ... } if (context.IsLiveMode) { // ... } if (context.IsPreviewMode) { // ... } } }
References
ASP.NET Core
Kentico Xperience
Product | Versions Compatible and additional computed target framework versions. |
---|---|
.NET | net5.0 was computed. net5.0-windows was computed. net6.0 was computed. net6.0-android was computed. net6.0-ios was computed. net6.0-maccatalyst was computed. net6.0-macos was computed. net6.0-tvos was computed. net6.0-windows was computed. net7.0 was computed. net7.0-android was computed. net7.0-ios was computed. net7.0-maccatalyst was computed. net7.0-macos was computed. net7.0-tvos was computed. net7.0-windows was computed. net8.0 was computed. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. |
.NET Core | netcoreapp3.1 is compatible. |
-
.NETCoreApp 3.1
- Kentico.Xperience.AspNetCore.WebApp (>= 13.0.0 && < 13.1.0)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.