Feature - HTML
Embed raw HTML directly on the page for third-party widgets, videos, and custom markup
What It Does#
Renders raw HTML directly on the page for embeds and custom markup
The HTML feature gives content editors the ability to paste raw HTML that gets rendered directly on the page. This is essential for embedding third-party content like YouTube videos, social media widgets, maps, or any other service that provides an embed code.
Unlike the Rich Text Editor which provides a WYSIWYG editing experience, the HTML feature accepts raw markup in a plain textarea. The content is output using Html.Raw() so it renders as actual HTML rather than escaped text.
How It Works#
A simple view that outputs unescaped HTML from a textarea property
The view is minimal — it uses Html.Raw() to output the contents of the featurePropertyFeatureHTML textarea property without escaping. This means whatever HTML the editor pastes is rendered exactly as-is on the page.
The feature composes featureComponentHTML which provides a single textarea property for the HTML markup. Combined with the standard feature compositions, editors can add a title and description above the embedded content to provide context.
The strongly-typed ModelsBuilder property is Model.Content.FeaturePropertyFeatureHtml, which returns the raw string from the textarea.
Example: YouTube Embed#
A YouTube video embedded using the HTML feature
On this page
featureHTML.cshtml#
@inherits Umbraco.Cms.Web.Common.Views.UmbracoViewPage<Umbraco.Cms.Core.Models.Blocks.BlockGridItem<FeatureHtml>>
@{
Layout = "_Layout_Features.cshtml";
}
@Html.Raw(Model.Content.FeaturePropertyFeatureHtml)