![]() |
VOOZH | about |
dotnet add package XperienceCommunity.PageBuilderTagHelpers --version 1.1.0
NuGet\Install-Package XperienceCommunity.PageBuilderTagHelpers -Version 1.1.0
<PackageReference Include="XperienceCommunity.PageBuilderTagHelpers" Version="1.1.0" />
<PackageVersion Include="XperienceCommunity.PageBuilderTagHelpers" Version="1.1.0" />Directory.Packages.props
<PackageReference Include="XperienceCommunity.PageBuilderTagHelpers" />Project file
paket add XperienceCommunity.PageBuilderTagHelpers --version 1.1.0
#r "nuget: XperienceCommunity.PageBuilderTagHelpers, 1.1.0"
#:package XperienceCommunity.PageBuilderTagHelpers@1.1.0
#addin nuget:?package=XperienceCommunity.PageBuilderTagHelpers&version=1.1.0Install as a Cake Addin
#tool nuget:?package=XperienceCommunity.PageBuilderTagHelpers&version=1.1.0Install as a Cake Tool
These libraries are compatible with ASP.NET Core 3.1 → ASP.NET Core 5 and are designed to be used with the Xperience 13.0 Content Delivery (MVC) application running on ASP.NET Core.
This library provides an abstraction over the Kentico Xperience Page Builder rendering mode so that developers can conditionally execute code based on the mode of a given HTTP request to their ASP.NET Core application.
First, install the NuGet package in your ASP.NET Core project:
dotnet add package XperienceCommunity.PageBuilderUtilities
Add the required types to the DI container in your Startup.cs file
public void ConfigureServices(IServiceCollection services)
{
services.AddPageBuilderContext();
}
You can now use the IPageBuilderContext from XperienceCommunity.PageBuilderUtilities as a constructor dependency anywhere in your application to more easily determine the state of the current request:
public class ProductsController
{
private readonly IPageBuilderContext context;
public ProductsController(IPageBuilderContext context) =>
this.context = context;
public ActionResult Index()
{
if (context.IsEditMode)
{
// ...
}
if (context.IsLivePreviewMode)
{
// ...
}
if (context.IsLiveMode)
{
// ...
}
if (context.IsPreviewMode)
{
// ...
}
}
}
By not using IHttpContextAccessor and all the Kentico Xperience extension methods, your code is both easier to unit test and read.
You can inject this type into your Razor views, but the better option is to use ... 👇
This library provides an ASP.NET Core Tag Helper for Kentico Xperience 13.0 to help toggle HTML in Razor views based on the Page Builder 'mode' of the request to the ASP.NET Core application.
First, install the NuGet package in your ASP.NET Core project
dotnet add package XperienceCommunity.PageBuilderTagHelpers
Add the required types to the DI container in your Startup.cs file
public void ConfigureServices(IServiceCollection services)
{
services.AddPageBuilderContext();
}
XperienceCommunity.PageBuilderUtilities package, above, which is a dependency of XperienceCommunity.PageBuilderTagHelpersInclude the tag helper assembly name in the ~/Views/_ViewImports.cshtml
@addTagHelper *, XperienceCommunity.PageBuilderTagHelpers
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>
<page-data-context>
<widget-zone />
</page-data-context>
<page-data-context initialized="false">
<div>widget placeholder!</div>
</page-data-context>
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net5.0 net5.0 was computed. net5.0-windows net5.0-windows was computed. net6.0 net6.0 was computed. net6.0-android net6.0-android was computed. net6.0-ios net6.0-ios was computed. net6.0-maccatalyst net6.0-maccatalyst was computed. net6.0-macos net6.0-macos was computed. net6.0-tvos net6.0-tvos was computed. net6.0-windows net6.0-windows was computed. net7.0 net7.0 was computed. net7.0-android net7.0-android was computed. net7.0-ios net7.0-ios was computed. net7.0-maccatalyst net7.0-maccatalyst was computed. net7.0-macos net7.0-macos was computed. net7.0-tvos net7.0-tvos was computed. net7.0-windows net7.0-windows was computed. net8.0 net8.0 was computed. net8.0-android net8.0-android was computed. net8.0-browser net8.0-browser was computed. net8.0-ios net8.0-ios was computed. net8.0-maccatalyst net8.0-maccatalyst was computed. net8.0-macos net8.0-macos was computed. net8.0-tvos net8.0-tvos was computed. net8.0-windows net8.0-windows was computed. net9.0 net9.0 was computed. net9.0-android net9.0-android was computed. net9.0-browser net9.0-browser was computed. net9.0-ios net9.0-ios was computed. net9.0-maccatalyst net9.0-maccatalyst was computed. net9.0-macos net9.0-macos was computed. net9.0-tvos net9.0-tvos was computed. net9.0-windows net9.0-windows was computed. net10.0 net10.0 was computed. net10.0-android net10.0-android was computed. net10.0-browser net10.0-browser was computed. net10.0-ios net10.0-ios was computed. net10.0-maccatalyst net10.0-maccatalyst was computed. net10.0-macos net10.0-macos was computed. net10.0-tvos net10.0-tvos was computed. net10.0-windows net10.0-windows was computed. |
| .NET Core | netcoreapp3.1 netcoreapp3.1 is compatible. |
Showing the top 2 NuGet packages that depend on XperienceCommunity.PageBuilderTagHelpers:
| Package | Downloads |
|---|---|
|
XperienceCommunity.Baseline.Core.Library.KX13
The Baseline a set of Core Systems, Tools, and Structure to ensure a superior Kentico Website that's easy to migrate, for Kentico Xperience 13 and eventually Xperience by Kentico |
|
|
XperienceCommunity.CQRS.Web
Package Description |
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|---|---|
| 1.1.0 | 86,483 | 12/30/2021 |
| 1.1.0-beta.1 | 327 | 12/30/2021 |
| 1.0.0 | 1,191 | 10/20/2021 |