I want to add #begin after .html in the URL (thus html#begin) , in order to open a webpage at a certain point of the page on small screens.

For instance, if I add Sitemap in the footer, it jumps to name="begin" at the sitemap page. That works fine in Contao 2.11.9.

But how can I do this with the URLs from the navigation menu ?? The page alias does not accept the #begin addition, because # is not alfa-numerical. The - Settings - URL suffix - also does not accept .html#begin.

With my previous website (2 years ago) I got the reply from Medianomaly in this forum, which worked like a charm, but now in Contao 2.11.9 is does not work anymore.

The solution in the older (2.9.4) version of Cantao was:

Tap into Contao's "generateFrontendUrl" hook to add this --

/system/modules/make-up-a-folder-name/config/config.php:

<?php $GLOBALS['TL_HOOKS']['generateFrontendUrl'][] = array('CustomUrls', 'generateCustomUrl'); ?>

/system/modules/same-folder-as-above/CustomUrls.php:

<?php
class CustomUrls
{
public function generateCustomUrl($arrRow, $strParams, $strUrl)
{
return $strUrl . '#begin';
}
}
?>


How can this be done in Contao 2.11.9 ? (Without of the method of making redirect towards every single page)

Thanks,
Bert