This page serves as a reference of all ASP.NET Core Tag Helpers (opens in a new tab) provided by the Xperience API.
You can add individual Tag Helpers to your views via the @addTagHelper directive. Specify the fully qualified name of the Tag Helper class and the name of the assembly where it is located (both provided in the corresponding sections below). Alternatively, you can use the '*' wildcard to include all Tag Helpers matching a specified pattern.
@* Adds all Tag Helpers from the Kentico.Content.Web.Mvc assembly to the view *@
@addTagHelper *, Kentico.Content.Web.Mvc
@* Adds the form zone Tag Helper to the view *@
@addTagHelper Kentico.Content.Web.Mvc.FormZoneTagHelper, Kentico.Content.Web.MvcAdd the Tag Helpers in relevant _ViewImports.cshtml (opens in a new tab) files to make them available in all related views automatically.
Fully qualified name: Kentico.Content.Web.Mvc.PageBuilderScriptsTagHelper
Assembly name: Kentico.Content.Web.Mvc
Renders markup that includes scripts required by the page builder feature. Serves as an alternative to the HtmlHelper.Kentico().PageBuilderScripts extension method.
The Tag Helper includes scripts used in the system's editing interface, as well as those of individual page builder components (widgets, sections, inline property editors, page templates). See the linked documentation to learn how to correctly add custom scripts for your own components.
@addTagHelper Kentico.Content.Web.Mvc.PageBuilderScriptsTagHelper, Kentico.Content.Web.Mvc
<page-builder-scripts />Fully qualified name: Kentico.Content.Web.Mvc.PageBuilderStylesTagHelper
Assembly name: Kentico.Content.Web.Mvc
Renders markup that includes style sheets required by the page builder feature. Serves as an alternative to the HtmlHelper.Kentico().PageBuilderStyles extension method.
The Tag Helper includes style sheets used in the system's editing interface, as well as those of individual page builder components (widgets, sections, inline property editors, page templates). See the linked documentation to learn how to correctly add custom style sheets for your own components.
@addTagHelper Kentico.Content.Web.Mvc.PageBuilderStylesTagHelper, Kentico.Content.Web.Mvc
<page-builder-styles />Fully qualified name: Kentico.Content.Web.Mvc.EditableAreaTagHelper
Assembly name: Kentico.Content.Web.Mvc
Marks a location where a page builder editable area is to be rendered when editing the page via the administration interface. Serves as an alternative to the HtmlHelper.Kentico().EditableAreaAsync extension method.
The helper has the following required attributes:
@addTagHelper Kentico.Content.Web.Mvc.EditableAreaTagHelper, Kentico.Content.Web.Mvc
<editable-area area-identifier="areaSimple" />Optionally, you can pass an EditableAreaOptions object via the area-options attribute to further configure the area. See Creating pages with editable areas for details.
@addTagHelper Kentico.Content.Web.Mvc.EditableAreaTagHelper, Kentico.Content.Web.Mvc
@using Kentico.PageBuilder.Web.Mvc
@{
var options = new EditableAreaOptions
{
AllowedWidgets = new[] { "LearningKit.Widgets.NumberWidget",
"LearningKit.Widgets.SomeOtherWidget" },
AllowedSections = AllowedComponents.ALL
};
}
<editable-area area-identifier="areaConfigured" area-options="options" />Alternatively, you can pass each property of the EditableAreaOptions object as an individual attribute:
Note that if you both pass the options object and specify some parameters directly via attributes, the parameters specified via attributes take precedence (i.e., override the corresponding properties of the options object).
The caching configuration options are modeled after and behave identically to the Cache tag helper (opens in a new tab) provided by ASP.NET Core:
@* widget-output-cache-expires-on *@
@* Sets the cached entry to expire on 5:02 PM on January 29, 2025. If the specified date is in the past, nothing gets cached. *@
<editable-area area-identifier="editableArea" area-widget-output-cache="true" widget-output-cache-expires-on="@new DateTime(2025,1,29,17,02,0)" />
@* widget-output-cache-expires-after *@
@* Contents are evicted after five minutes and cached again on subsequent requests. *@
<editable-area area-identifier="editableArea" area-widget-output-cache="true" widget-output-cache-expires-after="@TimeSpan.FromSeconds(300)" />
@* widget-output-cache-expires-sliding *@
@* Cached content is evicted if not accessed again within 120 seconds of the initial request. *@
<editable-area area-identifier="editableArea" area-widget-output-cache="true" widget-output-cache-expires-sliding="@TimeSpan.FromSeconds(120)" />Fully qualified name: Kentico.Content.Web.Mvc.WidgetZoneTagHelper
Assembly name: Kentico.Content.Web.Mvc
Marks a location where widgets can be placed within a page builder section. Serves as an alternative to the HtmlHelper.Kentico().WidgetZoneAsync extension method.
Every section must contain at least one widget zone – sections without widget zones are not supported.
@addTagHelper Kentico.Content.Web.Mvc.WidgetZoneTagHelper, Kentico.Content.Web.Mvc
<widget-zone />The helper also has the following optional attributes:
@{
var widgetsWhitelist = new[] { Kentico.Content.Web.Mvc.SystemComponentIdentifiers.FORM_WIDGET_IDENTIFIER,
"LearningKit.Widgets.NumberWidget",
"LearningKit.Widgets.SomeOtherWidget" };
}
<widget-zone zone-name="main-zone" allowed-widgets="widgetsWhitelist" />Fully qualified name: Kentico.Content.Web.Mvc.WidgetZoneTagHelper
Assembly name: Kentico.Content.Web.Mvc
Renders an invisible form field that includes contextual information about the page. Necessary when developing components that use POST actions. Serves as an alternative to the HtmlHelper.Kentico().PageData extension method.
@addTagHelper Kentico.Content.Web.Mvc.PageDataTagHelper, Kentico.Content.Web.Mvc
<form asp-controller="Controller" asp-action="HandlePost" id="form">
...
<page-data />
<input type="submit" value="Submit" />
</form>Fully qualified name: Kentico.Content.Web.Mvc.ComponentPropertiesDataTagHelper
Assembly name: Kentico.Content.Web.Mvc
Used to persist properties of the currently rendered component for POST actions. Server as an alternative to the HtmlHelper.Kentico().ComponentPropertiesData extension method.
@addTagHelper Kentico.Content.Web.Mvc.ComponentPropertiesDataTagHelper, Kentico.Content.Web.Mvc
<form asp-controller="Controller" asp-action="HandlePost" id="form">
...
<component-properties-data />
<input type="submit" value="Submit" />
</form>Fully qualified name: Kentico.Content.Web.Mvc.StandaloneWidgetTagHelper
Assembly name: Kentico.Content.Web.Mvc
Renders a specified widget directly. Serves as an alternative to the HtmlHelper.Kentico().RenderStandaloneWidget extension method. See Rendering widgets directly.
The helper has the following attributes:
@addTagHelper Kentico.Content.Web.Mvc.StandaloneWidgetTagHelper, Kentico.Content.Web.Mvc
@using Kentico.Forms.Web.Mvc.Widgets
@using Kentico.Content.Web.Mvc
@{
var widgetProperties = new FormWidgetProperties()
{
SelectedForm = "FormCodeName"
};
}
@* Renders the system's default Form widget *@
<standalone-widget widget-type-identifier="@SystemComponentIdentifiers.FORM_WIDGET_IDENTIFIER" widget-properties="widgetProperties" />Fully qualified name: Kentico.Content.Web.Mvc.NestedWidgetTagHelper
Assembly name: Kentico.Content.Web.Mvc
Renders a widget nested inside another widget. Serves as an alternative to the HtmlHelper.Kentico().RenderNestedWidget extension method. See Extending widgets.
@addTagHelper Kentico.Content.Web.Mvc.NestedWidgetTagHelper, Kentico.Content.Web.Mvc
@* In this example, the extended widget uses an extended FormWidgetProperties class *@
@model ComponentViewModel<ExtendedFormWidgetProperties>
@* Renders the system's default Form widget as the nested widget *@
<nested-widget widget-type-identifier="@SystemComponentIdentifiers.FORM_WIDGET_IDENTIFIER" widget-properties="Model.Properties" />Fully qualified name: Kentico.Content.Web.Mvc.FormZoneTagHelper
Assembly name: Kentico.Content.Web.Mvc
Marks a location where form components can be placed within a form section. Serves as an alternative to the HtmlHelper.Kentico().FormZoneAsync extension method.
@addTagHelper Kentico.Content.Web.Mvc.FormZoneTagHelper, Kentico.Content.Web.Mvc
<form-zone />The helper also has the following optional attributes:- zone-name – identifier of the zone used when changing the type of the zone in the page builder.
<form-zone zone-name="main-zone" />Fully qualified name: Kentico.Web.Mvc.Caching.CacheDependencyTagHelper
Assembly name: Kentico.Web.Mvc
Allows for specification of dependency cache keys within the Cache tag helper (opens in a new tab) element. See Caching page output in ASP.NET Core applications and Setting cache dependencies.
The helper has the following attributes:
@addTagHelper Kentico.Web.Mvc.Caching.CacheDependencyTagHelper, Kentico.Web.Mvc
@{
var userCacheKeys = new[] { "cms.user|all" };
var enabled = false;
}
<cache enabled="@enabled">
@* Clears the cached data whenever a user object is modified *@
<cache-dependency cache-keys="@userCacheKeys" enabled="@enabled" />
Time: @DateTime.Now
</cache>