[TYPO3-english] HMENU/TMENU mixes userfunction and a ghost sitemap

Daniel Neugebauer mailinglists at energiequant.de
Mon Apr 30 20:34:13 CEST 2012


A short reply to myself because I hate finding threads on the Internet
that end with the first post.

On 03/05/2012 05:41 PM, Daniel Neugebauer wrote:
> As you can see, it has no "sub menus". But: If we let it render this
> way, it lists parts of the site's page structure on a second category
> level (like a sitemap).

The cause lies within Typo3 core. I'm unable to find a workaround but
the issue is that empty submenus are not taken to the next iteration of
tslib_menu->makeMenu.

The first iteration calls the extension's user function to build the
array which is returned fine. Further iterations don't comply with
$this->menuNumber == 1, which is fine as long as
is_array($this->alternativeMenuTempArray) is true. Unfortunately, the
previous iteration of tslib_menu->subMenu did not replace the default
altArray = '' with an array before approaching

    if (is_array($altArray))        {
        $submenu->alternativeMenuTempArray = $altArray;
    }

This causes the default case of tslib_menu->makeMenu to happen, which
automatically builds another menu:

    $temp = $this->sys_page->getMenu($this->id,'*',$altSortField);
    // gets the menu


I tried a lot of different workarounds but none worked, e.g. setting the
default case to $altArray = array() causes this extensions category menu
to show up fine but other menus will stop rendering at level 1.

I'm not sure if something's wrong with the way the array is built, the
TypoScript is written or if this is a bug in Typo3 core but I'm running
out of time now so I will stop investigating this and write my own
rendering code...

Of course it would be great if someone with enough knowledge about Typo3
internals could shed some light on this topic.

Thanks,
Daniel


More information about the TYPO3-english mailing list