Skip to content

TYPO3 v12 support

The new version of this extension supports TYPO3 v11 as well as the upcoming TYPO3 v12.

To ensure compatibility with both TYPO3 versions, the old hook typolinkModifyParameterForPageLinks (v11) as well as the new PSR-14 event ModifyPageLinkConfigurationEvent (v12) are used.
The button to generate an anchor from the current header currently still uses a RequireJS module for both TYPO3 versions.

Possible configuration: value of header field as fallback for anchor

In the DataProcessor, hook as well as the new PSR-14 listener, the TypoScript setup is now processed even if no value is set in the "Human-readable URL #anchor" field.

The extension's default TypoScript provides the same check (see below), so there is no immediate change in behavior.

lib.contentElement.variables.fragmentIdentifier.if.isTrue.field = tx_content_slug_fragment

The frontend rendering can now be configured so that the content element's header is used as a fallback (or even the primary source) for the human-readable URL fragment. The following lines will modify/extend the default TypoScript:

lib.contentElement.variables.fragmentIdentifier {
  // Remove the above-mentioned check:
  if >
  // If the fragment field is empty, use the header field as a fallback:
  20.ifEmpty.field = header
  // Sanitize the value of the header field:
  stdWrap.postUserFunc = Sebkln\ContentSlug\Evaluation\FragmentEvaluation->sanitizeFragment

For most TYPO3 projects, I still strongly recommend to use the given URL anchor field and the button next to it. This allows for human-readable URL fragments which remain independent of the header and can be optimized manually.

Back to news list