This extension enhances the existing TYPO3 content elements, which are commonly rendered with EXT:fluid_styled_content. Therefore, customized Fluid templates have to be provided by this extension.

It also works well with the Bootstrap Package.

In both cases, be sure to load the configuration of this extension after EXT:fluid_styled_content or EXT:bootstrap_package.

TypoScript setup

You can configure the fragment identifier with TypoScript.

If you customize the templates, override the template paths of the content elements.

lib.contentElement {
    partialRootPaths.101 = EXT:content_slug/Resources/Private/Overrides/fluid_styled_content/Partials/
    templateRootPaths.101 = EXT:content_slug/Resources/Private/Overrides/fluid_styled_content/Templates/

Fluid templates

The customized Fluid templates contain some new variables and ViewHelpers to render the contents of the new fields.


We need to transfer additional variables to Header.html:

1<f:render partial="Header/Header" arguments="{
2    header: data.header,
3    layout: data.header_layout,
4    positionClass: '{f:if(condition: data.header_position, then: \'ce-headline-{data.header_position}\')}',
5    link: data.header_link,
6    fragmentIdentifier: fragmentIdentifier,
7    renderAnchorLink: data.tx_content_slug_link,
8    default: settings.defaultHeaderType}" />


Each heading (<h1> to <h5>) gets a new id attribute. It will contain the configured fragment identifier, if a fragment was set in the content element.

If a fragment exists and the checkbox "Set link to #anchor" is activated, an additional link will be rendered right to the header.

You can style this anchor through the class name and/or change the displayed symbol in the template.

1<h1 id="{fragmentIdentifier}" class="{positionClass}">
2    <f:link.typolink parameter="{link}">{header}</f:link.typolink>
3    <f:if condition="{fragmentIdentifier} && {renderAnchorLink}"><a class="headline-anchor" href="#{fragmentIdentifier}">#</a></f:if>


Note the spelling: with # in the anchor link, without # in the id attribute!

Also important: if header_layout is set to default, the Header.html partial is called a second time. Therefore, we need to transfer our additional variables again:

 2    <f:if condition="{default}">
 3        <f:render partial="Header/Header" arguments="{
 4            header: header,
 5            layout: default,
 6            positionClass: positionClass,
 7            fragmentIdentifier: fragmentIdentifier,
 8            renderAnchorLink: renderAnchorLink,
 9            link: link}"/>
10    </f:if>


The TYPO3 content elements of CType "Section Index" and "Section Index of subpages from selected pages" both build a list of pages and their included content elements.

By default, the content elements will be linked by their unique id, e.g. https://www.example.org/a-sub-page/#c123.

The new Fluid condition will check if a fragment identifier is given for the content element.


The human-readable fragment can only rendered if the header is not hidden. Therefore, we also need to check if the header_layout is set to 100.

This is taken care of in the custom DataProcessor, which is added to both Section Index menus.

If available, the configured fragment identifier is then rendered (identical to the anchor link in Header.html).

Otherwise, the default anchor to the content element is rendered (#c123).

 1<f:for each="{page.content}" as="element">
 2    <f:if condition="{element.data.header}">
 3    <li>
 4        <a href="{page.link}#{f:if(condition: '{element.fragmentIdentifier}', then: '{element.fragmentIdentifier}', else: 'c{element.data.uid}')}"
 5            {f:if(condition: page.target, then: ' target="{page.target}"')} title="{element.data.header}">
 6            <span>{element.data.header}</span>
 7        </a>
 8    </li>
 9    </f:if>


The same changes apply in MenuSectionPages.html.