Search code examples
slugtypo3-9.x

TYPO3 9.5.5 - Speaking URLs not generated in a second menu


In my current TYPO3 9.5.5 "classic mode" project, 3 menu blocks are managed in folder sturctures like this:

RootPage
- Home (-> this is a separate menu)
- [FOLDER FOR MAIN MENU]
-- Menu 1
-- Menu 2
-- Menu 3
- [FOLDER FOR META MENU]
-- Contact
-- Privacy Protection

The menu is generated via MenuProcessors like this:

page.10.FLUIDTEMPLATE.dataProcessing {
        // Main menu
        20 = TYPO3\CMS\Frontend\DataProcessing\MenuProcessor
        20 {
            special = directory
            special.value = {$mainMenuFolderPid}
            as = menuMain
            titleField = nav_title // title
            expandAll = 1
            includeSpacer = 0
            levels = 3
        }

        // Meta menu
        25 = TYPO3\CMS\Frontend\DataProcessing\MenuProcessor
        25 {
            special = directory
            special.value = {$metaMenuFolderPid}
            as = menuMeta
                       ...
        }
}

While the home menu and the main menu work as expected in respect to speaking urls, the meta menu does not create speaking urls correctly, but instead uses the page title directly, meaning that the "c" in Contact is indeed capitalized, so are the "p"s in Privacy Protection, which also has and empty space. The resulting URL format looks like this:

https://domain.tld/Contact
https://domain.tld/Privacy Protection

which causes a 404 (the one defined in “site configuration”; 404 works fine).

If I change the meta menu to list and add the page ids manually, the same wrong result for that menu is generated.

Strangely enough, when opening the contact page directly from the backend, the correct url (domain.tld/contact.html) is generated (even if I rename the slug manually).

Can anybody help me understand, what I am doing wrong here, please?


Solution

  • That sound like a misspelled object notation in the menu provider. A link will be generated, if you use menuItem.link. But it seems you get the title with something like menuItem.page.title.