> For the complete documentation index, see [llms.txt](https://docs.umbraco.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.umbraco.com/umbraco-cms/13.latest/fundamentals/design/templates/named-sections.md).

# Named Sections

Using named sections in Umbraco

Template sections support the ability to add additional *Named Sections* to layout templates. These sections can be defined anywhere in the layout file (including within the section of the HTML) and allow you to output dynamic content in your template.

## Defining a Named Section

You can define a part of your template as a named section by wrapping it in `@section`. This can be rendered in a specific area of the parent of this template, by using `@RenderSection`.

For example, you can define the following section within a child template like a Content page:

```csharp
@section Contact
{
    <div class="container">
        <div class="row section">
            <div class="col-md-9">
                <p>@Model.AuthorName()</p> 
            </div>
        </div>
    </div>

}
```

To define a Named Section, follow these steps:

1. Go to **Settings**.
2. Navigate to a template and click **Sections**.

   <figure><img src="https://3872888104-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FgEH4FChbCn7eDDqREvdE%2Fuploads%2Fgit-blob-cbff077027ed89b24be96d4cdce1029a20a492a3%2FSections-option.png?alt=media" alt=""><figcaption></figcaption></figure>
3. Select **Define a named section** and enter the **Section Name**.

   <figure><img src="https://3872888104-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FgEH4FChbCn7eDDqREvdE%2Fuploads%2Fgit-blob-2f2ae76a25e918d20892cccb507c5d59325210ad%2FDefine-named-section.png?alt=media" alt=""><figcaption></figcaption></figure>
4. Click **Submit**.

## Render a Name Section

Renders a named area of a child template, by inserting a `@RenderSection(name)` placeholder. This renders an area of a child template that is wrapped in a corresponding `@section [name]` definition.

For example, you can define the following section within a Master template:

```csharp
@RenderSection("Contact", false)
```

To render a Named Section, follow these steps:

1. Go to **Settings**.
2. Navigate to a template and click **Sections**.

   <figure><img src="https://3872888104-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FgEH4FChbCn7eDDqREvdE%2Fuploads%2Fgit-blob-cbff077027ed89b24be96d4cdce1029a20a492a3%2FSections-option.png?alt=media" alt=""><figcaption></figcaption></figure>
3. Select **Render a named section** and enter the **Section Name**.

   <figure><img src="https://3872888104-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FgEH4FChbCn7eDDqREvdE%2Fuploads%2Fgit-blob-07bfb69de7dee3975d6181b423f7f9de2d6aff72%2FRender-named-sections.png?alt=media" alt=""><figcaption></figcaption></figure>
4. \[Optional] Select **Section is mandatory**. This means that the child templates need to have the named section defined for them to work.
5. Click **Submit**.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.umbraco.com/umbraco-cms/13.latest/fundamentals/design/templates/named-sections.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
