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
DefaultItemAreaTemplate
public const string DefaultItemAreaTemplate = "area"
Field Value
DefaultItemAreasTemplate
public const string DefaultItemAreasTemplate = "areas"
Field Value
DefaultItemsTemplate
public const string DefaultItemsTemplate = "items"
Field Value
DefaultTemplate
public const string DefaultTemplate = "default"
Field Value
Methods
GetBlockGridHtml(IHtmlHelper, BlockGridModel?, string)
public static IHtmlContent GetBlockGridHtml(this IHtmlHelper html, BlockGridModel? model, string template = "default")
Parameters
htmlIHtmlHelpermodelBlockGridModeltemplatestring
Returns
GetBlockGridHtml(IHtmlHelper, IPublishedContent, string)
public static IHtmlContent GetBlockGridHtml(this IHtmlHelper html, IPublishedContent contentItem, string propertyAlias)
Parameters
htmlIHtmlHelpercontentItemIPublishedContentpropertyAliasstring
Returns
GetBlockGridHtml(IHtmlHelper, IPublishedContent, string, string)
public static IHtmlContent GetBlockGridHtml(this IHtmlHelper html, IPublishedContent contentItem, string propertyAlias, string template)
Parameters
htmlIHtmlHelpercontentItemIPublishedContentpropertyAliasstringtemplatestring
Returns
GetBlockGridHtml(IHtmlHelper, IPublishedProperty, string)
public static IHtmlContent GetBlockGridHtml(this IHtmlHelper html, IPublishedProperty property, string template = "default")
Parameters
htmlIHtmlHelperpropertyIPublishedPropertytemplatestring
Returns
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
htmlIHtmlHelpermodelBlockGridModeltemplatestring
Returns
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
htmlIHtmlHelpercontentItemIPublishedContentpropertyAliasstring
Returns
GetBlockGridHtmlAsync(IHtmlHelper, IPublishedContent, string, string)
public static Task<IHtmlContent> GetBlockGridHtmlAsync(this IHtmlHelper html, IPublishedContent contentItem, string propertyAlias, string template)
Parameters
htmlIHtmlHelpercontentItemIPublishedContentpropertyAliasstringtemplatestring
Returns
GetBlockGridHtmlAsync(IHtmlHelper, IPublishedProperty, string)
public static Task<IHtmlContent> GetBlockGridHtmlAsync(this IHtmlHelper html, IPublishedProperty property, string template = "default")
Parameters
htmlIHtmlHelperpropertyIPublishedPropertytemplatestring
Returns
GetBlockGridItemAreaHtml(IHtmlHelper, BlockGridArea, string)
public static IHtmlContent GetBlockGridItemAreaHtml(this IHtmlHelper html, BlockGridArea area, string template = "area")
Parameters
htmlIHtmlHelperareaBlockGridAreatemplatestring
Returns
GetBlockGridItemAreaHtml(IHtmlHelper, BlockGridItem, string, string)
public static IHtmlContent GetBlockGridItemAreaHtml(this IHtmlHelper html, BlockGridItem item, string areaAlias, string template = "area")
Parameters
htmlIHtmlHelperitemBlockGridItemareaAliasstringtemplatestring
Returns
GetBlockGridItemAreaHtmlAsync(IHtmlHelper, BlockGridArea, string)
public static Task<IHtmlContent> GetBlockGridItemAreaHtmlAsync(this IHtmlHelper html, BlockGridArea area, string template = "area")
Parameters
htmlIHtmlHelperareaBlockGridAreatemplatestring
Returns
GetBlockGridItemAreaHtmlAsync(IHtmlHelper, BlockGridItem, string, string)
public static Task<IHtmlContent> GetBlockGridItemAreaHtmlAsync(this IHtmlHelper html, BlockGridItem item, string areaAlias, string template = "area")
Parameters
htmlIHtmlHelperitemBlockGridItemareaAliasstringtemplatestring
Returns
GetBlockGridItemAreasHtml(IHtmlHelper, BlockGridItem, string)
public static IHtmlContent GetBlockGridItemAreasHtml(this IHtmlHelper html, BlockGridItem item, string template = "areas")
Parameters
htmlIHtmlHelperitemBlockGridItemtemplatestring
Returns
GetBlockGridItemAreasHtmlAsync(IHtmlHelper, BlockGridItem, string)
public static Task<IHtmlContent> GetBlockGridItemAreasHtmlAsync(this IHtmlHelper html, BlockGridItem item, string template = "areas")
Parameters
htmlIHtmlHelperitemBlockGridItemtemplatestring
Returns
GetBlockGridItemsHtml(IHtmlHelper, IEnumerable<BlockGridItem>, string)
public static IHtmlContent GetBlockGridItemsHtml(this IHtmlHelper html, IEnumerable<BlockGridItem> items, string template = "items")
Parameters
htmlIHtmlHelperitemsIEnumerable<BlockGridItem>templatestring
Returns
GetBlockGridItemsHtmlAsync(IHtmlHelper, IEnumerable<BlockGridItem>, string)
public static Task<IHtmlContent> GetBlockGridItemsHtmlAsync(this IHtmlHelper html, IEnumerable<BlockGridItem> items, string template = "items")
Parameters
htmlIHtmlHelperitemsIEnumerable<BlockGridItem>templatestring