[Typo3] Problem with menus

CJackson at firstambank.com CJackson at firstambank.com
Thu Aug 4 16:31:52 CEST 2005





I'm trying to create a userdefined menu for a page I'm working on, but I
can't seem to get it to work right. I've looked at the TSRef for HMENUs,
and it looks like I'm doing everything right, but the menu just doesn't
display properly.

Here's the TS I put in my template:
includeLibs.user_menu = fileadmin/user_menu_test.php

page.10 {
   subparts.MENU.special = userfunction
   subparts.MENU.special.userFunc = user_menu_test->makeMenuTest
   ...

And the code for the function:
    function makeMenuTest($content, $conf) {
        return array(
             array(
                 'title' => 'Contact',
                 '_OVERRIDE_HREF' => 'index.php?id=10',
                 '_SUB_MENU' => array(
                     array(
                         'title' => 'Offices',
                         '_OVERRIDE_HREF' => 'index.php?id=11',
                         '_OVERRIDE_TARGET' => '_top',
                         'ITEM_STATE' => 'ACT',
                         '_SUB_MENU' => array(
                             array(
                                 'title' => 'Copenhagen Office',
                                 '_OVERRIDE_HREF' =>
'index.php?id=11&officeId=cph',
                             ),
                             array(
                                 'title' => 'Paris Office',
                                 '_OVERRIDE_HREF' =>
'index.php?id=11&officeId=paris',
                             ),
                             array(
                                 'title' => 'New York Office',
                                 '_OVERRIDE_HREF' =>
'http://www.newyork-office.com',
                                 '_OVERRIDE_TARGET' => '_blank',
                             )
                         )
                     ),
                     array(
                         'title' => 'Form',
                         '_OVERRIDE_HREF' =>
'index.php?id=10&cmd=showform',
                     ),
                     array(
                         'title' => 'Thank you',
                         '_OVERRIDE_HREF' =>
'index.php?id=10&cmd=thankyou',
                     ),
                 ),
             ),
             array(
                 'title' => 'Products',
                 '_OVERRIDE_HREF' => 'index.php?id=14'
             )
         );
    }

When I load the page, two menu items appear: 'Contact' and 'Products'.
However, neither item is actually a link, and the menus won't expand,
either. If I add a uid field to either the 'Contact' or 'Products' array,
that item works correctly. I don't know if it's something with the TS for
my menu system or what. I didn't want to include it right away because
there's a lot of it, but I'll send it if requested.

Thanks,
Charlie Jackson



More information about the TYPO3-english mailing list