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
html
IHtmlHelpermodel
BlockGridModeltemplate
string
Returns
GetBlockGridHtml(IHtmlHelper, IPublishedContent, string)
public static IHtmlContent GetBlockGridHtml(this IHtmlHelper html, IPublishedContent contentItem, string propertyAlias)
Parameters
html
IHtmlHelpercontentItem
IPublishedContentpropertyAlias
string
Returns
GetBlockGridHtml(IHtmlHelper, IPublishedContent, string, string)
public static IHtmlContent GetBlockGridHtml(this IHtmlHelper html, IPublishedContent contentItem, string propertyAlias, string template)
Parameters
html
IHtmlHelpercontentItem
IPublishedContentpropertyAlias
stringtemplate
string
Returns
GetBlockGridHtml(IHtmlHelper, IPublishedProperty, string)
public static IHtmlContent GetBlockGridHtml(this IHtmlHelper html, IPublishedProperty property, string template = "default")
Parameters
html
IHtmlHelperproperty
IPublishedPropertytemplate
string
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
html
IHtmlHelpermodel
BlockGridModeltemplate
string
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
html
IHtmlHelpercontentItem
IPublishedContentpropertyAlias
string
Returns
GetBlockGridHtmlAsync(IHtmlHelper, IPublishedContent, string, string)
public static Task<IHtmlContent> GetBlockGridHtmlAsync(this IHtmlHelper html, IPublishedContent contentItem, string propertyAlias, string template)
Parameters
html
IHtmlHelpercontentItem
IPublishedContentpropertyAlias
stringtemplate
string
Returns
GetBlockGridHtmlAsync(IHtmlHelper, IPublishedProperty, string)
public static Task<IHtmlContent> GetBlockGridHtmlAsync(this IHtmlHelper html, IPublishedProperty property, string template = "default")
Parameters
html
IHtmlHelperproperty
IPublishedPropertytemplate
string
Returns
GetBlockGridItemAreaHtml(IHtmlHelper, BlockGridArea, string)
public static IHtmlContent GetBlockGridItemAreaHtml(this IHtmlHelper html, BlockGridArea area, string template = "area")
Parameters
html
IHtmlHelperarea
BlockGridAreatemplate
string
Returns
GetBlockGridItemAreaHtml(IHtmlHelper, BlockGridItem, string, string)
public static IHtmlContent GetBlockGridItemAreaHtml(this IHtmlHelper html, BlockGridItem item, string areaAlias, string template = "area")
Parameters
html
IHtmlHelperitem
BlockGridItemareaAlias
stringtemplate
string
Returns
GetBlockGridItemAreaHtmlAsync(IHtmlHelper, BlockGridArea, string)
public static Task<IHtmlContent> GetBlockGridItemAreaHtmlAsync(this IHtmlHelper html, BlockGridArea area, string template = "area")
Parameters
html
IHtmlHelperarea
BlockGridAreatemplate
string
Returns
GetBlockGridItemAreaHtmlAsync(IHtmlHelper, BlockGridItem, string, string)
public static Task<IHtmlContent> GetBlockGridItemAreaHtmlAsync(this IHtmlHelper html, BlockGridItem item, string areaAlias, string template = "area")
Parameters
html
IHtmlHelperitem
BlockGridItemareaAlias
stringtemplate
string
Returns
GetBlockGridItemAreasHtml(IHtmlHelper, BlockGridItem, string)
public static IHtmlContent GetBlockGridItemAreasHtml(this IHtmlHelper html, BlockGridItem item, string template = "areas")
Parameters
html
IHtmlHelperitem
BlockGridItemtemplate
string
Returns
GetBlockGridItemAreasHtmlAsync(IHtmlHelper, BlockGridItem, string)
public static Task<IHtmlContent> GetBlockGridItemAreasHtmlAsync(this IHtmlHelper html, BlockGridItem item, string template = "areas")
Parameters
html
IHtmlHelperitem
BlockGridItemtemplate
string
Returns
GetBlockGridItemsHtml(IHtmlHelper, IEnumerable<BlockGridItem>, string)
public static IHtmlContent GetBlockGridItemsHtml(this IHtmlHelper html, IEnumerable<BlockGridItem> items, string template = "items")
Parameters
html
IHtmlHelperitems
IEnumerable<BlockGridItem>template
string
Returns
GetBlockGridItemsHtmlAsync(IHtmlHelper, IEnumerable<BlockGridItem>, string)
public static Task<IHtmlContent> GetBlockGridItemsHtmlAsync(this IHtmlHelper html, IEnumerable<BlockGridItem> items, string template = "items")
Parameters
html
IHtmlHelperitems
IEnumerable<BlockGridItem>template
string