PHPackages                             4viewture/headless-menu - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. 4viewture/headless-menu

ActiveTypo3-cms-extension[Utility &amp; Helpers](/categories/utility)

4viewture/headless-menu
=======================

Menu via json for TYPO3, might be used in Webcomponents and to speed up page generation

1.0.0(4mo ago)012GPL-2.0+PHP

Since Feb 13Pushed 4mo agoCompare

[ Source](https://github.com/4viewture/headlessmenu)[ Packagist](https://packagist.org/packages/4viewture/headless-menu)[ Docs](https://www.4viewture.de)[ RSS](/packages/4viewture-headless-menu/feed)WikiDiscussions main Synced today

READMEChangelog (1)Dependencies (3)Versions (2)Used By (0)

Headless Menu for TYPO3
=======================

[](#headless-menu-for-typo3)

This TYPO3 extension provides a JSON endpoint for generating menus. It is particularly useful for Webcomponents or headless frontend integrations where you need a slim, JSON-based representation of your page navigation.

Features
--------

[](#features)

- Generates a menu as JSON.
- Custom `WhitelistMenuFieldsProcessor` to filter exactly which fields are exposed in the JSON output.
- Configurable menu depth and field selection via TypoScript.
- Lightweight and cacheable via TYPO3's native page caching.

Installation
------------

[](#installation)

Install via composer:

```
composer require 4viewture/headless-menu
```

Then, include the TypoScript template in your TYPO3 site configuration.

Usage
-----

[](#usage)

### JSON Endpoint

[](#json-endpoint)

The extension provides a new page type. You can access the menu JSON by appending `type=1770960021` to your URL:

```
https://your-domain.com/?type=1770960021

```

By default, the menu is only generated for the site's root page (`site("rootPageId")`) to prevent unnecessary cache entries for every single page.

This extension is compatible with TYPO3 v12, v13, and v14 as it uses modern TypoScript conditions.

#### Output example

[](#output-example)

With the standard configuration, the output will look like this:

```
[
    {
        "title": "Start",
        "link": "\/startseite.html",
        "target": "",
        "data": {
            "uid": 641,
            "nav_title": "",
            "slug": "\/start"
        },
        "children": [
            {
                "title": "Angebote",
                "link": "\/angebote.html",
                "target": "",
                "data": {
                    "uid": 5,
                    "nav_title": "",
                    "slug": "\/angebote"
                }
            },
            {
                "title": "Lesezeichen",
                "link": "\/start\/lesezeichen-1.html",
                "target": "",
                "data": {
                    "uid": 2908,
                    "nav_title": "",
                    "slug": "\/start\/lesezeichen-1"
                }
            }
        ]
    }
]
```

### TypoScript Configuration

[](#typoscript-configuration)

The following TypoScript constants are available to customize the menu output:

ConstantDefault ValueDescription`lib.tx_headlessmenu.menu.level``7`How many levels deep the menu should be generated.`lib.tx_headlessmenu.menu.fields``title,link,target,children`Main fields to include for each menu item.`lib.tx_headlessmenu.menu.dataFields``uid,slug,nav_title`Specific fields from the raw record to include in the `data` section.`lib.tx_headlessmenu.menu.childrenKey``children`The key used for nesting child menu items.`lib.tx_headlessmenu.menu.header.allowOrigin`(empty)Define `Access-Control-Allow-Origin` header.`lib.tx_headlessmenu.menu.page.typeNum``1770960021`The `typeNum` used for the JSON endpoint.CORS Support
------------

[](#cors-support)

You can enable CORS by setting the `lib.tx_headlessmenu.menu.header.allowOrigin` constant. If set, it will also add `Access-Control-Allow-Methods: GET, OPTIONS`.

```
# Example
lib.tx_headlessmenu.menu.header.allowOrigin = *

```

Data Processor
--------------

[](#data-processor)

The extension includes a custom DataProcessor: `FourViewture\HeadlessMenu\DataProcessing\WhitelistMenuFieldsProcessor`.

It can be used in your own Fluid templates or TypoScript to filter menu arrays:

```
20 = FourViewture\HeadlessMenu\DataProcessing\WhitelistMenuFieldsProcessor
20 {
  as = menu
  fields = title,link,active
  dataFields = uid,nav_title
  childrenKey = children
}

```

Authors
-------

[](#authors)

- **Kay Strobach** - [4viewture](https://www.4viewture.de)

License
-------

[](#license)

This project is licensed under the GPL-2.0+ License.

###  Health Score

31

—

LowBetter than 66% of packages

Maintenance74

Regular maintenance activity

Popularity5

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity34

Early-stage or recently created project

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Unknown

Total

1

Last Release

140d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/3c6681704a769ab93a20ba54d94054d0f3f1e81b99341e8cfa29d91f6d8f16fb?d=identicon)[kaystrobach](/maintainers/kaystrobach)

---

Top Contributors

[![kaystrobach](https://avatars.githubusercontent.com/u/1185776?v=4)](https://github.com/kaystrobach "kaystrobach (2 commits)")

---

Tags

extensiontypo3

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/4viewture-headless-menu/health.svg)

```
[![Health](https://phpackages.com/badges/4viewture-headless-menu/health.svg)](https://phpackages.com/packages/4viewture-headless-menu)
```

###  Alternatives

[friendsoftypo3/content-blocks

TYPO3 CMS Content Blocks - Content Types API | Define reusable components via YAML

103519.9k53](/packages/friendsoftypo3-content-blocks)[wazum/sluggi

TYPO3 extension for URL slug management with inline editing, auto-sync, locking, access control, and redirects

40529.5k](/packages/wazum-sluggi)[friendsoftypo3/tt-address

Displays a list of addresses from an address table on the page.

461.8M44](/packages/friendsoftypo3-tt-address)[friendsoftypo3/visual-editor

TYPO3 CMS Visual Editor - Brings a modern WYSIWYG editing experience to TYPO3 CMS.

576.1k2](/packages/friendsoftypo3-visual-editor)[quellenform/t3x-iconpack

Provides an iconpack-registry for custom iconpacks.

1552.6k27](/packages/quellenform-t3x-iconpack)[t3brightside/pagelist

TYPO3 CMS extension to create news, events, vacancies and products or just page lists. Demo: microtemplate.t3brightside.com

1121.5k1](/packages/t3brightside-pagelist)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
