Table of Contents

Class BlockGridTemplateExtensions

Namespace
Umbraco.Extensions
Assembly
Umbraco.Web.Common.dll
public static class BlockGridTemplateExtensions
Inheritance
BlockGridTemplateExtensions
Inherited Members

Fields

DefaultFolder

public const string DefaultFolder = "blockgrid/"

Field Value

string

DefaultItemAreaTemplate

public const string DefaultItemAreaTemplate = "area"

Field Value

string

DefaultItemAreasTemplate

public const string DefaultItemAreasTemplate = "areas"

Field Value

string

DefaultItemsTemplate

public const string DefaultItemsTemplate = "items"

Field Value

string

DefaultTemplate

public const string DefaultTemplate = "default"

Field Value

string

Methods

GetBlockGridHtml(IHtmlHelper, BlockGridModel?, string)

public static IHtmlContent GetBlockGridHtml(this IHtmlHelper html, BlockGridModel? model, string template = "default")

Parameters

html IHtmlHelper
model BlockGridModel
template string

Returns

IHtmlContent

GetBlockGridHtml(IHtmlHelper, IPublishedContent, string)

public static IHtmlContent GetBlockGridHtml(this IHtmlHelper html, IPublishedContent contentItem, string propertyAlias)

Parameters

html IHtmlHelper
contentItem IPublishedContent
propertyAlias string

Returns

IHtmlContent

GetBlockGridHtml(IHtmlHelper, IPublishedContent, string, string)

public static IHtmlContent GetBlockGridHtml(this IHtmlHelper html, IPublishedContent contentItem, string propertyAlias, string template)

Parameters

html IHtmlHelper
contentItem IPublishedContent
propertyAlias string
template string

Returns

IHtmlContent

GetBlockGridHtml(IHtmlHelper, IPublishedProperty, string)

public static IHtmlContent GetBlockGridHtml(this IHtmlHelper html, IPublishedProperty property, string template = "default")

Parameters

html IHtmlHelper
property IPublishedProperty
template string

Returns

IHtmlContent

GetBlockGridHtmlAsync(IHtmlHelper, BlockGridModel?, string)

Renders a block grid model into a grid layout

public static Task<IHtmlContent> GetBlockGridHtmlAsync(this IHtmlHelper html, BlockGridModel? model, string template = "default")

Parameters

html IHtmlHelper
model BlockGridModel
template string

Returns

Task<IHtmlContent>

Remarks

By default this method uses a set of built-in partial views for rendering the blocks and areas in the grid model. These partial views are embedded in the static assets (Umbraco.Cms.StaticAssets), so they won't show up in the Views folder on your local disk.

If you need to tweak the grid rendering output, you can copy the partial views from GitHub to your local disk. The partial views are found in "/src/Umbraco.Cms.StaticAssets/Views/Partials/blockgrid/" on GitHub and should be copied to "Views/Partials/BlockGrid/" on your local disk.

See Also

GetBlockGridHtmlAsync(IHtmlHelper, IPublishedContent, string)

public static Task<IHtmlContent> GetBlockGridHtmlAsync(this IHtmlHelper html, IPublishedContent contentItem, string propertyAlias)

Parameters

html IHtmlHelper
contentItem IPublishedContent
propertyAlias string

Returns

Task<IHtmlContent>

GetBlockGridHtmlAsync(IHtmlHelper, IPublishedContent, string, string)

public static Task<IHtmlContent> GetBlockGridHtmlAsync(this IHtmlHelper html, IPublishedContent contentItem, string propertyAlias, string template)

Parameters

html IHtmlHelper
contentItem IPublishedContent
propertyAlias string
template string

Returns

Task<IHtmlContent>

GetBlockGridHtmlAsync(IHtmlHelper, IPublishedProperty, string)

public static Task<IHtmlContent> GetBlockGridHtmlAsync(this IHtmlHelper html, IPublishedProperty property, string template = "default")

Parameters

html IHtmlHelper
property IPublishedProperty
template string

Returns

Task<IHtmlContent>

GetBlockGridItemAreaHtml(IHtmlHelper, BlockGridArea, string)

public static IHtmlContent GetBlockGridItemAreaHtml(this IHtmlHelper html, BlockGridArea area, string template = "area")

Parameters

html IHtmlHelper
area BlockGridArea
template string

Returns

IHtmlContent

GetBlockGridItemAreaHtml(IHtmlHelper, BlockGridItem, string, string)

public static IHtmlContent GetBlockGridItemAreaHtml(this IHtmlHelper html, BlockGridItem item, string areaAlias, string template = "area")

Parameters

html IHtmlHelper
item BlockGridItem
areaAlias string
template string

Returns

IHtmlContent

GetBlockGridItemAreaHtmlAsync(IHtmlHelper, BlockGridArea, string)

public static Task<IHtmlContent> GetBlockGridItemAreaHtmlAsync(this IHtmlHelper html, BlockGridArea area, string template = "area")

Parameters

html IHtmlHelper
area BlockGridArea
template string

Returns

Task<IHtmlContent>

GetBlockGridItemAreaHtmlAsync(IHtmlHelper, BlockGridItem, string, string)

public static Task<IHtmlContent> GetBlockGridItemAreaHtmlAsync(this IHtmlHelper html, BlockGridItem item, string areaAlias, string template = "area")

Parameters

html IHtmlHelper
item BlockGridItem
areaAlias string
template string

Returns

Task<IHtmlContent>

GetBlockGridItemAreasHtml(IHtmlHelper, BlockGridItem, string)

public static IHtmlContent GetBlockGridItemAreasHtml(this IHtmlHelper html, BlockGridItem item, string template = "areas")

Parameters

html IHtmlHelper
item BlockGridItem
template string

Returns

IHtmlContent

GetBlockGridItemAreasHtmlAsync(IHtmlHelper, BlockGridItem, string)

public static Task<IHtmlContent> GetBlockGridItemAreasHtmlAsync(this IHtmlHelper html, BlockGridItem item, string template = "areas")

Parameters

html IHtmlHelper
item BlockGridItem
template string

Returns

Task<IHtmlContent>

GetBlockGridItemsHtml(IHtmlHelper, IEnumerable<BlockGridItem>, string)

public static IHtmlContent GetBlockGridItemsHtml(this IHtmlHelper html, IEnumerable<BlockGridItem> items, string template = "items")

Parameters

html IHtmlHelper
items IEnumerable<BlockGridItem>
template string

Returns

IHtmlContent

GetBlockGridItemsHtmlAsync(IHtmlHelper, IEnumerable<BlockGridItem>, string)

public static Task<IHtmlContent> GetBlockGridItemsHtmlAsync(this IHtmlHelper html, IEnumerable<BlockGridItem> items, string template = "items")

Parameters

html IHtmlHelper
items IEnumerable<BlockGridItem>
template string

Returns

Task<IHtmlContent>