---
title: "TMENU"
manual: "TypoScript Explained"
version: "main"
permalink: "https://docs.typo3.org/permalink/t3tsref:tmenu@main"
source: "ContentObjects/Hmenu/Tmenu/Index.rst"
rendered: "2026-09-18T06:55:17+00:00"
---

# TMENU {#tmenu-1}

> [!WARNING]
> This TypoScript object is still available to provide backward compatibility
> for old sites. When creating a new menu or refactoring an existing one
> always use the [menu data processor](https://docs.typo3.org/permalink/t3tsref:menuprocessor@main)
> and a Fluid template.

For examples on how to use the TMENU please refer to old version of this
document, for example [TMENU](https://docs.typo3.org/m/typo3/reference-typoscript/11.5/en-us/ContentObjects/Hmenu/Tmenu/Index.html#tmenu)-.

-   [TMENUITEM](https://docs.typo3.org/permalink/t3tsref:tmenuitem-1@main)

-   [TMENU item states](https://docs.typo3.org/permalink/t3tsref:tmenu-item-states@main)
-   [Properties](https://docs.typo3.org/permalink/t3tsref:properties@main)

## TMENU item states {#tmenu-item-states}

These properties are all the item states used by `TMENU`.

> [!WARNING]
> Be aware to properly escape menu item content in order to prevent
> Cross-site scripting vulnerabilities. It is therefore highly recommended
> to use `stdWrap.htmlSpecialChars = 1` in all TMENU item states.

The following Item states are listed from the least to the highest priority:

**TMENU item states**

**NO**

-   **NO**

    -   *Type:* [boolean](https://docs.typo3.org/permalink/t3tsref:data-type-boolean@main) / [TMENUITEM](https://docs.typo3.org/permalink/t3tsref:tmenuitem@main)
    -   *Default:* 1 (true)

    The default "Normal" state rendering of Item. This is required for all
    menus.

**IFSUB**

-   **IFSUB**

    -   *Type:* [boolean](https://docs.typo3.org/permalink/t3tsref:data-type-boolean@main) / [TMENUITEM](https://docs.typo3.org/permalink/t3tsref:tmenuitem@main)
    -   *Default:* 0

    Enable/Configuration for menu items which has subpages.

**ACT**

-   **ACT**

    -   *Type:* [boolean](https://docs.typo3.org/permalink/t3tsref:data-type-boolean@main) / [TMENUITEM](https://docs.typo3.org/permalink/t3tsref:tmenuitem@main)
    -   *Default:* 0

    Enable/Configuration for menu items which are found in the rootLine.

**ACTIFSUB**

-   **ACTIFSUB**

    -   *Type:* [boolean](https://docs.typo3.org/permalink/t3tsref:data-type-boolean@main) / [TMENUITEM](https://docs.typo3.org/permalink/t3tsref:tmenuitem@main)
    -   *Default:* 0

    Enable/Configuration for menu items which are found in the rootLine
    and have subpages.

**CUR**

-   **CUR**

    -   *Type:* [boolean](https://docs.typo3.org/permalink/t3tsref:data-type-boolean@main) / [TMENUITEM](https://docs.typo3.org/permalink/t3tsref:tmenuitem@main)
    -   *Default:* 0

    Enable/Configuration for a menu item if the item is the current page.

**CURIFSUB**

-   **CURIFSUB**

    -   *Type:* [boolean](https://docs.typo3.org/permalink/t3tsref:data-type-boolean@main) / [TMENUITEM](https://docs.typo3.org/permalink/t3tsref:tmenuitem@main)
    -   *Default:* 0

    Enable/Configuration for a menu item if the item is the current page
    and has subpages.

**USR**

-   **USR**

    -   *Type:* [boolean](https://docs.typo3.org/permalink/t3tsref:data-type-boolean@main) / [TMENUITEM](https://docs.typo3.org/permalink/t3tsref:tmenuitem@main)
    -   *Default:* 0

    Enable/Configuration for menu items which are access restricted pages
    that a user has access to.

**SPC**

-   **SPC**

    -   *Type:* [boolean](https://docs.typo3.org/permalink/t3tsref:data-type-boolean@main) / [TMENUITEM](https://docs.typo3.org/permalink/t3tsref:tmenuitem@main)
    -   *Default:* 0

    Enable/Configuration for 'Spacer' pages.

    Spacers are pages of the doktype "Spacer". These are not viewable
    pages but "placeholders" which can be used to divide menu items.

**USERDEF1**

-   **USERDEF1**

    -   *Type:* [boolean](https://docs.typo3.org/permalink/t3tsref:data-type-boolean@main) / [TMENUITEM](https://docs.typo3.org/permalink/t3tsref:tmenuitem@main)

    User-defined, see [itemArrayProcFunc](https://docs.typo3.org/permalink/t3tsref:confval-menu-common-properties-itemarrayprocfunc@main) for details on how
    to use this.

    You can set the ITEM_STATE values USERDEF1 and USERDEF2 (+...RO) from
    a script/user function processing the menu item array. See the property
    [itemArrayProcFunc](https://docs.typo3.org/permalink/t3tsref:confval-menu-common-properties-itemarrayprocfunc@main) of the menu objects.

**USERDEF2**

-   **USERDEF2**

    -   *Type:* [boolean](https://docs.typo3.org/permalink/t3tsref:data-type-boolean@main) / [TMENUITEM](https://docs.typo3.org/permalink/t3tsref:tmenuitem@main)

    Same like [USERDEF1](https://docs.typo3.org/permalink/t3tsref:confval-tmenu-common-property-userdef1@main) but has a higher
    priority.

## Properties {#properties}

**TMENU Properties**

**expAll**

-   **expAll**

    -   *Type:* [boolean](https://docs.typo3.org/permalink/t3tsref:data-type-boolean@main) / [stdWrap](https://docs.typo3.org/permalink/t3tsref:stdwrap@main)

    If this is true, the menu will always show the menu on the level
    underneath the menu item. This corresponds to a situation where a user
    has clicked a menu item and the menu folds out the next level. This
    can enable that to happen on all items as default.

**sectionIndex**

-   **sectionIndex**

    -   *Type:* [boolean](https://docs.typo3.org/permalink/t3tsref:data-type-boolean@main)

    If this property is set, then the
    menu will not consist of links to pages on the "next level" but rather
    of links to the parent page to the menu, and in addition "#"-links to
    the cObjects rendered on the page. In other words, the menu items will
    be a section index with links to the content elements on the page (by
    default with colPos=0!).

    If you set this, all content elements (from tt_content table) of
    "Column" = "Normal" *and* the "Index"-check box clicked are selected.
    This corresponds to the "Menu/Sitemap" content element when "Section
    index" is selected as type.

    **sectionIndex.type**

    -   **sectionIndex.type**

        -   *Type:* [string](https://docs.typo3.org/permalink/t3tsref:data-type-string@main) ("all" / "header")

        -   **"all"**

            The "Index"-checkbox is not considered and all content elements - by
            default with colPos=0 - are selected.

        -   **"header"**

            Only content elements with a visible header-layout (and a
            non-empty 'header'-field!) are selected. In other words, if the
            header layout of an element is set to "Hidden" then the
            page will not appear in the menu.

    **sectionIndex.includeHiddenHeaders**

    -   **sectionIndex.includeHiddenHeaders**

        -   *Type:* [boolean](https://docs.typo3.org/permalink/t3tsref:data-type-boolean@main)

        If you set this and sectionIndex.type is set to "header",
        also elements with a header layout set to "Hidden" will appear
        in the menu.

    **sectionIndex.useColPos**

    -   **sectionIndex.useColPos**

        -   *Type:* [integer](https://docs.typo3.org/permalink/t3tsref:data-type-integer@main) / [stdWrap](https://docs.typo3.org/permalink/t3tsref:stdwrap@main)
        -   *Default:* 0

        This property allows you to set the colPos which should be used in the
        where clause of the query. Possible values are integers, default is "0".

        Any positive integer and 0 will lead to a where clause containing
        "colPos=x" with x being the aforementioned integer. A negative value
        drops the filter "colPos=x" completely.

        **EXT:site_package/Configuration/Sets/Main/setup.typoscript**

        ```typoscript
        tt_content.menu.20.3.1.sectionIndex.useColPos = -1
        ```

**target**

-   **target**

    -   *Type:* string
    -   *Default:* self

    Target of the menu links

**forceTypeValue**

-   **forceTypeValue**

    -   *Type:* [integer](https://docs.typo3.org/permalink/t3tsref:data-type-integer@main)

    If set, the `&type` parameter of the link is forced to this value
    regardless of target.

**stdWrap**

-   **stdWrap**

    -   *Type:* [stdWrap](https://docs.typo3.org/permalink/t3tsref:stdwrap@main)

    Wraps the whole block of sub items.

**wrap**

-   **wrap**

    -   *Type:* [wrap](https://docs.typo3.org/permalink/t3tsref:data-type-wrap@main)

    Wraps the whole block of sub items, but only if there were items in the menu!

**IProcFunc**

-   **IProcFunc**

    -   *Type:* function name

    The internal array "I" is passed to this function and expected
    returned as well. Subsequent to this function call the menu item is
    compiled by implode()'ing the array $I\[parts\] in the passed array.
    Thus you may modify this if you need to.

**alternativeSortingField**

-   **alternativeSortingField**

    -   *Type:* [string](https://docs.typo3.org/permalink/t3tsref:data-type-string@main)

    Normally the menu items are sorted by the fields "sorting" in the
    pages- and tt_content-table. Here you can enter a list of fields that
    is used in the SQL- "ORDER BY" statement instead. You can also provide
    the sorting order.

    **Limitations:**

    This property works with normal menus, sectionsIndex menus and
    special-menus of type "directory".

**minItems**

-   **minItems**

    -   *Type:* [integer](https://docs.typo3.org/permalink/t3tsref:data-type-integer@main) / [stdWrap](https://docs.typo3.org/permalink/t3tsref:stdwrap@main)

    The minimum items in the menu. If the number of pages does not reach
    this level, a dummy-page with the title "..." and
    uid=\[currentpage_id\] is inserted.

    Takes precedence over HMENU property [](https://docs.typo3.org/permalink/t3tsref:hmenu-minitems@main).

**maxItems**

-   **maxItems**

    -   *Type:* [integer](https://docs.typo3.org/permalink/t3tsref:data-type-integer@main) / [stdWrap](https://docs.typo3.org/permalink/t3tsref:stdwrap@main)

    The maximum items in the menu. More items will be ignored.

    Takes precedence over HMENU property [](https://docs.typo3.org/permalink/t3tsref:hmenu-maxitems@main).

**begin**

-   **begin**

    -   *Type:* [integer](https://docs.typo3.org/permalink/t3tsref:data-type-integer@main) / [stdWrap](https://docs.typo3.org/permalink/t3tsref:stdwrap@main) [+calc](https://docs.typo3.org/permalink/t3tsref:objects-calc@main)

    The first item in the menu.

**debugItemConf**

-   **debugItemConf**

    -   *Type:* [boolean](https://docs.typo3.org/permalink/t3tsref:data-type-boolean@main)

    Outputs (by the `debug()` function) the configuration arrays for each
    menu item. Useful to debug [optionSplit](https://docs.typo3.org/permalink/t3tsref:optionsplit@main) things and such...

**overrideId**

-   **overrideId**

    -   *Type:* [integer](https://docs.typo3.org/permalink/t3tsref:data-type-integer@main) (page id)

    If set, then all links in the menu will point to this pageid. Instead
    the real uid of the page is sent by the parameter "&real_uid=\[uid\]".

    This feature is smart, if you have inserted a menu from somewhere
    else, perhaps a shared menu, but wants the menu items to call the same
    page, which then generates a proper output based on the real_uid.

**addParams**

-   **addParams**

    -   *Type:* [string](https://docs.typo3.org/permalink/t3tsref:data-type-string@main)

    Additional parameter for the menu links.

    Must be rawurlencoded.

**showAccessRestrictedPages**

-   **showAccessRestrictedPages**

    -   *Type:* [integer](https://docs.typo3.org/permalink/t3tsref:data-type-integer@main) (page ID) / keyword "NONE"

    If set, pages in the menu will include pages with frontend user group
    access enabled. However the page is of course not accessible and
    therefore the URL in the menu will be linked to the page with the ID
    of this value. On that page you could put a login form or other
    message.

    If the value is "NONE" the link will not be changed and the site will
    perform page-not-found handling when clicked (which can be used to
    capture the event and act accordingly of course). This means that the
    link's URL will point to the page even if it is not accessible by the
    current frontend user. Note that the default behavior of page-not-found
    handling is to show the parent page instead.

    **Properties:**

    **.addParam**: Additional parameter for the URL, which can hold two
    markers; ###RETURN_URL### which will be substituted with the link the
    page would have had if it had been accessible and ###PAGE_ID###
    holding the page ID of the page coming from (could be used to look up
    which fe_groups was required for access.

    **.ATagParams**: Add custom attributes to the anchor tag.

**additionalWhere**

-   **additionalWhere**

    -   *Type:* [string](https://docs.typo3.org/permalink/t3tsref:data-type-string@main) / [stdWrap](https://docs.typo3.org/permalink/t3tsref:stdwrap@main)

    Adds an additional part to the WHERE clause for this menu.
    Make sure to start the part with "AND "!

**itemArrayProcFunc**

-   **itemArrayProcFunc**

    -   *Type:* function name

    The first variable passed to this function is the "menuArr" array with
    the menu items as they are collected based on the type of menu.

    You're free to manipulate or add to this array as you like. Just
    remember to return the array again!

    **Note:**

    .parentObj property is **hardcoded** to be a reference to the calling
    typo3/sysext/frontend/Classes/ContentObject/Menu/ object. Here you'll
    find e.g. ->id to be the uid of the menu item generating a submenu and
    such.

    **Presetting element state**

    You can override element states like SPC, IFSUB, ACT, CUR or USR by
    setting the key ITEM_STATE in the page records.

**submenuObjSuffixes**

-   **submenuObjSuffixes**

    -   *Type:* [string](https://docs.typo3.org/permalink/t3tsref:data-type-string@main) / [optionSplit](https://docs.typo3.org/permalink/t3tsref:optionsplit@main)

    Defines a suffix for alternative sub-level menu objects.
