test
Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • kflynn Friend
    #153726

    Hi,

    I have 2 mega menu setups. I’d like to show relevent menu if user is logged in and default menu if user is not logged in

    if (logged in) { show logged in menu }
    else { show default public menu }

    I’ve opened up mainnav.php however the menu is loaded via direct php. Can anybody point me in right direction please.

    I can do a check to see if user is logged in or not, but how do I then load relevent menu id.

    Thanks

    Khanh Le Moderator
    #353410

    It can be done by overriding mainnav block. Copy the base theme block mainnav (plugins/system/jat3/base-themes/default/blocks/mainnav.php) to folder templates/ja_t3_blank/blocks, then open for edit. Copy this block of code to very top of the file:
    [php]
    <?php
    $user = & JFactory::getUser();
    if ($user->get(‘guest’)) {
    //not login
    T3Parameter::_setParam (‘menutype’, ‘pubic_menu’);
    } else {
    //login
    T3Parameter::_setParam (‘menutype’, ‘logged_in_menu’);
    }
    ?>
    [/php]

Viewing 2 posts - 1 through 2 (of 2 total)

This topic contains 2 replies, has 2 voices, and was last updated by  Khanh Le 14 years, 3 months ago.

We moved to new unified forum. Please post all new support queries in our New Forum