Renders the content of the specified section if it's defined.
If the section is not defined, renders the provided content.
- Namespace
- Statiq
.Razor - Containing Type
- StatiqRazorPage
<TModel>
Syntax
public IHtmlContent RenderSection(string name, Func<dynamic, HelperResult> defaultContents)
Parameters
| Name | Type | Description |
|---|---|---|
| name | string | The name of the section to render. |
| defaultContents | Func |
The default content to render if the section is not defined. |
Return Value
| Type | Description |
|---|---|
| IHtmlContent | The HTML content. |