Interface IUmbracoComponentRenderer
Methods used to render umbraco components as HTML in templates
Namespace: Umbraco.Web
Assembly: Umbraco.Web.dll
Syntax
public interface IUmbracoComponentRenderer
Methods
View SourceRenderMacro(Int32, String)
Renders the macro with the specified alias.
Declaration
IHtmlString RenderMacro(int contentId, string alias)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | contentId | |
System.String | alias | The alias. |
Returns
Type | Description |
---|---|
System.Web.IHtmlString |
RenderMacro(Int32, String, IDictionary<String, Object>)
Renders the macro with the specified alias, passing in the specified parameters.
Declaration
IHtmlString RenderMacro(int contentId, string alias, IDictionary<string, object> parameters)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | contentId | |
System.String | alias | The alias. |
System.Collections.Generic.IDictionary<System.String, System.Object> | parameters | The parameters. |
Returns
Type | Description |
---|---|
System.Web.IHtmlString |
RenderMacro(Int32, String, Object)
Renders the macro with the specified alias, passing in the specified parameters.
Declaration
IHtmlString RenderMacro(int contentId, string alias, object parameters)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | contentId | |
System.String | alias | The alias. |
System.Object | parameters | The parameters. |
Returns
Type | Description |
---|---|
System.Web.IHtmlString |
RenderMacroForContent(IPublishedContent, String, IDictionary<String, Object>)
Renders the macro with the specified alias, passing in the specified parameters.
Declaration
IHtmlString RenderMacroForContent(IPublishedContent content, string alias, IDictionary<string, object> parameters)
Parameters
Type | Name | Description |
---|---|---|
IPublishedContent | content | An IPublishedContent to use for the context for the macro rendering |
System.String | alias | The alias. |
System.Collections.Generic.IDictionary<System.String, System.Object> | parameters | The parameters. |
Returns
Type | Description |
---|---|
System.Web.IHtmlString | A raw HTML string of the macro output |
Remarks
Currently only used when the node is unpublished and unable to get the contentId item from the content cache as its unpublished. This deals with taking in a preview/draft version of the content node
RenderTemplate(Int32, Nullable<Int32>)
Renders the template for the specified pageId and an optional altTemplateId
Declaration
IHtmlString RenderTemplate(int contentId, int? altTemplateId = null)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | contentId | |
System.Nullable<System.Int32> | altTemplateId | If not specified, will use the template assigned to the node |
Returns
Type | Description |
---|---|
System.Web.IHtmlString |