---
title: "Section ViewHelper <f:section>"
manual: "Fluid Explained"
version: "main"
permalink: "https://docs.typo3.org/permalink/fluid:typo3fluid-fluid-section"
source: "ViewHelpers/Fluid/Section.rst"
rendered: "2026-10-08T14:12:40+00:00"
---

# Section ViewHelper `<f:section>` {#typo3fluid-fluid-section}

> [!NOTE]
> This reference is part of the documentation of Fluid Standalone.
> If you are working with Fluid in TYPO3 CMS, please refer to
> [TYPO3's ViewHelper reference](https://docs.typo3.org/other/typo3/view-helper-reference/14.3/en-us/Global/Section.html) instead.

A ViewHelper to declare sections in templates for later use with e.g. the `f:render` ViewHelper.

## Examples {#examples}

### Rendering sections {#rendering-sections}

```php
<f:section name="someSection">This is a section. {foo}</f:section>
<f:render section="someSection" arguments="{foo: someVariable}" />

```

Output:

```php
the content of the section "someSection". The content of the variable {someVariable} will be available in the partial as {foo}

```

### Rendering recursive sections {#rendering-recursive-sections}

```php
<f:section name="mySection">
   <ul>
        <f:for each="{myMenu}" as="menuItem">
             <li>
               {menuItem.text}
               <f:if condition="{menuItem.subItems}">
                   <f:render section="mySection" arguments="{myMenu: menuItem.subItems}" />
               </f:if>
             </li>
        </f:for>
   </ul>
</f:section>
<f:render section="mySection" arguments="{myMenu: menu}" />

```

Output:

```php
<ul>
    <li>menu1
        <ul>
            <li>menu1a</li>
            <li>menu1b</li>
        </ul>
    </li>
[...]
(depending on the value of {menu})
```

Go to the source code of this ViewHelper: [SectionViewHelper.php (GitHub)](https://github.com/TYPO3/Fluid/blob/main/src/ViewHelpers/SectionViewHelper.php).

**Arguments**

The following arguments are available for the section ViewHelper:

-   **name**

    -   *Type:* string
    -   *Required:* true

    Name of the section
