Skip to content

Why is there a check for hidden headers?

By default, this extension renders the human-readable fragment as an id attribute on the content element's header. If a header is hidden (non-rendered), the link target would be missing. In that case, a given fragment will not be used. Instead, TYPO3 falls back to its default: the UID of the content element (#c123), which is set in its fluid layout.

This mechanism works both in “Section Index” menus and for links in the RTE.

New setting in TypoScript and Site Settings

The configuration settings.checkForHiddenHeaders now allows to disable the check if needed. In this case, the integrator is responsible for adapting the Fluid templates: The variable {fragmentIdentifier} must be set as an id attribute on an HTML element that is always rendered.

The simple option is adding it to the Fluid layout of content elements:

<html xmlns:f="http://typo3.org/ns/TYPO3/CMS/Fluid/ViewHelpers" data-namespace-typo3-fluid="true">
    <f:if condition="{data.frame_class} != none">
        <f:then>
            <div id="c{data.uid}" class="frame frame-{data.frame_class} frame-type-{data.CType} frame-layout-{data.layout}{f:if(condition: data.space_before_class, then: ' frame-space-before-{data.space_before_class}')}{f:if(condition: data.space_after_class, then: ' frame-space-after-{data.space_after_class}')}">
                <f:if condition="{data._LOCALIZED_UID}">
                    <a id="c{data._LOCALIZED_UID}"></a>
                </f:if>
                <f:if condition="{fragmentIdentifier}">
                    <div id="{fragmentIdentifier}"></div>
                </f:if>
                <f:render section="Before" optional="true">
                    <f:render partial="DropIn/Before/All" arguments="{_all}" />
                </f:render>
                <f:render section="Header" optional="true">
                    <f:render partial="Header/All" arguments="{_all}" />
                </f:render>
                <f:render section="Main" optional="true" />
                <f:render section="Footer" optional="true">
                    <f:render partial="Footer/All" arguments="{_all}" />
                </f:render>
                <f:render section="After" optional="true">
                    <f:render partial="DropIn/After/All" arguments="{_all}" />
                </f:render>
            </div>
        </f:then>
        <f:else>
            <a id="c{data.uid}"></a>
            <f:if condition="{data._LOCALIZED_UID}">
                <a id="c{data._LOCALIZED_UID}"></a>
            </f:if>
            <f:if condition="{fragmentIdentifier}">
                <div id="{fragmentIdentifier}"></div>
            </f:if>
            <f:if condition="{data.space_before_class}">
                <div class="frame-space-before-{data.space_before_class}"></div>
            </f:if>
            <f:render section="Before" optional="true">
                <f:render partial="DropIn/Before/All" arguments="{_all}" />
            </f:render>
            <f:render section="Header" optional="true">
                <f:render partial="Header/All" arguments="{_all}" />
            </f:render>
            <f:render section="Main" optional="true" />
            <f:render section="Footer" optional="true">
                <f:render partial="Footer/All" arguments="{_all}" />
            </f:render>
            <f:render section="After" optional="true">
                <f:render partial="DropIn/After/All" arguments="{_all}" />
            </f:render>
            <f:if condition="{data.space_after_class}">
                <div class="frame-space-after-{data.space_after_class}"></div>
            </f:if>
        </f:else>
    </f:if>
</html>

The {fragmentIdentifier} must not be rendered in the header partials then. The following TypoScript will remove the path to the partials provided by this extension:

lib.contentElement.partialRootPaths.101 >

In addition, the checkbox “Set link to #anchor” should be disabled via Page TSconfig if you do not render this link elsewhere in the HTML.

Back to news list