XperienceCommunity.DevTools.PageBuilderTagHelpers
2.0.0
dotnet add package XperienceCommunity.DevTools.PageBuilderTagHelpers --version 2.0.0
NuGet\Install-Package XperienceCommunity.DevTools.PageBuilderTagHelpers -Version 2.0.0
<PackageReference Include="XperienceCommunity.DevTools.PageBuilderTagHelpers" Version="2.0.0" />
<PackageVersion Include="XperienceCommunity.DevTools.PageBuilderTagHelpers" Version="2.0.0" />
<PackageReference Include="XperienceCommunity.DevTools.PageBuilderTagHelpers" />
paket add XperienceCommunity.DevTools.PageBuilderTagHelpers --version 2.0.0
#r "nuget: XperienceCommunity.DevTools.PageBuilderTagHelpers, 2.0.0"
#:package XperienceCommunity.DevTools.PageBuilderTagHelpers@2.0.0
#addin nuget:?package=XperienceCommunity.DevTools.PageBuilderTagHelpers&version=2.0.0
#tool nuget:?package=XperienceCommunity.DevTools.PageBuilderTagHelpers&version=2.0.0
Xperience Page Builder Utilities
This is an updated version of Sean's xperience-page-builder-utilities for Xperience by Kentico
Packages
Dependencies
These libraries are compatible with ASP.NET Core 8.0+ and are designed to be used with the Xperience by Kentico 30.0 and above application running on ASP.NET Core.
Library Version Matrix
| Xperience Version | Library Version |
|---|---|
| >= 31.0.0 | 2.x |
| 30.0.0-30.12.3 | 1.x |
Page Builder Utilities
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.
How to Use?
First, install the NuGet package in your ASP.NET Core project:
dotnet add package XperienceCommunity.DevTools.PageBuilderUtilitiesAdd the required types to the DI container in your project's
Startup.csfilepublic void ConfigureServices(IServiceCollection services) { services.AddPageBuilderContext(); }You can now use the
IPageBuilderContextinterface (available in theXperienceCommunity.DevTools.PageBuilderUtilitiesnamespace) 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
IHttpContextAccessorand 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 ... 👇
Page Builder Tag Helpers
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.
How to Use?
First, install the NuGet package in your ASP.NET Core project
dotnet add package XperienceCommunity.DevTools.PageBuilderTagHelpersAdd the required types to the DI container in your
Startup.csfilepublic void ConfigureServices(IServiceCollection services) { services.AddPageBuilderContext(); }- Note: This extension method comes from the
XperienceCommunity.DevTools.PageBuilderUtilitiespackage, above, which is a dependency ofXperienceCommunity.DevTools.PageBuilderTagHelpers
- Note: This extension method comes from the
Include the tag helper assembly name in the
~/Views/_ViewImports.cshtml@addTagHelper *, XperienceCommunity.DevTools.PageBuilderTagHelpersUse 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>
Contributing
To build this project, you must have v8.0 or higher of the .NET SDK installed.
If you've found a bug or have a feature request, please open an issue on GitHub.
If you'd like to make a contribution, you can create a PR on GitHub.
References
Real World Examples
- Kentico Xperience: MVC Widget Experiments Part 2 - Page Specific Marketing Tags with Widgets
- Kentico Xperience: MVC Widget Experiments Part 3 - Unused Widgets Section
ASP.NET Core
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net8.0 is compatible. 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. net9.0 was computed. net9.0-android was computed. net9.0-browser was computed. net9.0-ios was computed. net9.0-maccatalyst was computed. net9.0-macos was computed. net9.0-tvos was computed. net9.0-windows was computed. net10.0 was computed. net10.0-android was computed. net10.0-browser was computed. net10.0-ios was computed. net10.0-maccatalyst was computed. net10.0-macos was computed. net10.0-tvos was computed. net10.0-windows was computed. |
-
net8.0
- Kentico.Xperience.WebApp (>= 31.0.0)
- XperienceCommunity.DevTools.PageBuilderUtilities (>= 2.0.0)
NuGet packages (1)
Showing the top 1 NuGet packages that depend on XperienceCommunity.DevTools.PageBuilderTagHelpers:
| Package | Downloads |
|---|---|
|
Baseline.Core.RCL
Baseline v3 Core RCL - Razor views, Tag Helpers, and View Components for Xperience by Kentico. |
GitHub repositories
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|---|---|
| 2.0.0 | 459 | 12/17/2025 |
| 2.0.0-prerelease-14-1 | 288 | 12/17/2025 |
| 1.0.3 | 1,238 | 12/18/2024 |
| 1.0.3-prerelease-6-1 | 129 | 12/18/2024 |
| 1.0.0 | 168 | 12/18/2024 |
| 1.0.0-prerelease-4-1 | 142 | 12/18/2024 |
| 1.0.0-prerelease-3-1 | 137 | 12/18/2024 |
| 1.0.0-prerelease-2-1 | 154 | 12/18/2024 |