---
title: "Feature: #107056 - Introduce headerData and footerData ViewHelpers"
manual: "TYPO3 Core Changelog"
version: "main"
permalink: "https://docs.typo3.org/permalink/changelog:feature-107056-1753012116"
source: "Changelog/14.0/Feature-107056-IntroduceHeaderDataAndFooterDataViewHelpers.rst"
typo3-version: "14.0"
typo3-major: 14
type: "feature"
issue: 107056
forge: "https://forge.typo3.org/issues/107056"
tags: ["Fluid", "ext:fluid"]
rendered: "2026-10-01T19:27:47+00:00"
---

# Feature: #107056 - Introduce headerData and footerData ViewHelpers {#feature-107056-1753012116}

See [forge#107056](https://forge.typo3.org/issues/107056)

## Description {#description}

Two new Fluid ViewHelpers have been introduced to allow injecting arbitrary
content into the HTML `<head>` or before the closing `</body>` tag
of a rendered page:

-   `<f:page.headerData>` \- injects content into the `<head>` section
-   `<f:page.footerData>` \- injects content before the closing `</body>` tag

The ViewHelpers internally use the `\TYPO3\CMS\Core\Page\PageRenderer`
API and are useful when existing ViewHelpers such as
`<f:asset.css>` or `<f:asset.script>` do not support all required
attributes or use cases (for example, `dns-prefetch`, `preconnect`,
tracking scripts, or inline JavaScript).

Example usage for `<f:page.headerData>`:

```html
<f:page.headerData>
    <link
        rel="preload"
        href="/fonts/myfont.woff2"
        as="font"
        type="font/woff2"
        crossorigin="anonymous"
    >
    <link rel="dns-prefetch" href="//example-cdn.com">
    <link rel="preconnect" href="https://example-cdn.com">
</f:page.headerData>
```

Example usage for `<f:page.footerData>`:

```html
<f:page.footerData>
    <script>
        var _paq = window._paq = window._paq || [];
        _paq.push(['trackPageView']);
        _paq.push(['enableLinkTracking']);
        (function() {
            var u = "https://your-matomo-domain.example.com/";
            _paq.push(['setTrackerUrl', u + 'matomo.php']);
            _paq.push(['setSiteId', '1']);
            var d = document,
                g = d.createElement('script'),
                s = d.getElementsByTagName('script')[0];
            g.async = true;
            g.src = u + 'matomo.js';
            s.parentNode.insertBefore(g, s);
        })();
    </script>
</f:page.footerData>
```

Both ViewHelpers output the given content as-is. Any user-supplied input passed
to these ViewHelpers must be escaped manually to prevent Cross-Site Scripting
(XSS) vulnerabilities.

## Impact {#impact}

Extension authors and integrators can now use the new ViewHelpers to add raw
HTML content, such as `<link>` or `<script>` tags, directly into
the rendered page output.
