test
Viewing 7 posts - 1 through 7 (of 7 total)
  • Author
    Posts
  • andyg Friend
    #191485

    Hi All,

    The current version of the T3 framework renders Megamenu only in the fixed nav element “t3-mainnav”. The problem is that we cannot create multiple Megamenus for different pages.

    How to render Megamenu inside a custom module? In that case I could create multiple Megamenus and assign them to different pages as needed.

    What is the right code to place in the module’s default.php to do this? I tried

    <?php
    $t3app = T3::getApp($this);
    $t3app->megamenu($t3app->getParam('mm_type', 'mainmenu'));
    ?>

    It works, but I am not sure if I need the whole T3 framework to load before. What is the minimum required T3 intialization code to load Megamenu inside a module?

    Thanks!

    Wall Crasher Developer
    #509406

    Hi andyg,

    The framework will be automatically load when you run a T3 template.

    When you call T3::getApp, just make sure you have call it after the template index.php loaded.
    Or you need to pass a Document Object (it is somehow complicated).
    You do not have to pass any parameter.

    Anyway, it is working, so you can just test your site to make sure it is ok.

    Regards

    andyg Friend
    #509417

    <em>@Wall Crasher 394138 wrote:</em><blockquote>Hi andyg,

    The framework will be automatically load when you run a T3 template.

    When you call T3::getApp, just make sure you have call it after the template index.php loaded.
    Or you need to pass a Document Object (it is somehow complicated).
    You do not have to pass any parameter.

    Anyway, it is working, so you can just test your site to make sure it is ok.

    Regards</blockquote>
    Thanks. Do I need to unset the class instance at the end?

    Wall Crasher Developer
    #509624

    No, you do not have to do it.
    T3::getApp will return the factory instance.

    olejenya Friend
    #513170

    <em>@andyg 394102 wrote:</em><blockquote>Hi All,

    The current version of the T3 framework renders Megamenu only in the fixed nav element “t3-mainnav”. The problem is that we cannot create multiple Megamenus for different pages.

    How to render Megamenu inside a custom module? In that case I could create multiple Megamenus and assign them to different pages as needed.

    What is the right code to place in the module’s default.php to do this? I tried

    <?php
    $t3app = T3::getApp($this);
    $t3app->megamenu($t3app->getParam('mm_type', 'mainmenu'));
    ?>

    It works, but I am not sure if I need the whole T3 framework to load before. What is the minimum required T3 intialization code to load Megamenu inside a module?

    Thanks!</blockquote>

    Hi. Turned cause megamenyu through the module and bring megamenyu several different menu items? Give more information about the implementation. Thank you) I would like that this could be done at the template level course. It would be very comfortable and cool. The desired functionality.

    olejenya Friend
    #513171

    <em>@andyg 394102 wrote:</em><blockquote>Hi All,

    The current version of the T3 framework renders Megamenu only in the fixed nav element “t3-mainnav”. The problem is that we cannot create multiple Megamenus for different pages.

    How to render Megamenu inside a custom module? In that case I could create multiple Megamenus and assign them to different pages as needed.

    What is the right code to place in the module’s default.php to do this? I tried

    <?php
    $t3app = T3::getApp($this);
    $t3app->megamenu($t3app->getParam('mm_type', 'mainmenu'));
    ?>

    Hey. Turned cause megamenyu through the module and bring megamenyu several different menu items? Give more information about the implementation. Thank you) I would like that this could be done at the template level course. It would be very comfortable and cool. The desired functionality.
    It works, but I am not sure if I need the whole T3 framework to load before. What is the minimum required T3 intialization code to load Megamenu inside a module?

    Thanks!</blockquote>

    Hi. Turned cause megamenyu through the module and bring megamenyu several different menu items? Give more information about the implementation. Thank you) I would like that this could be done at the template level course. It would be very comfortable and cool. The desired functionality.

    Wall Crasher Developer
    #513349

    Hi olejenya,

    If you want a module that you will need to call the function as above in module.

    <?php
    $t3app = T3::getApp();
    $t3app->megamenu('the_menu_type');
    ?>

    if you want to show the megamenu at in those tplblocks code (in the template), you just need to show this markup

    <jdoc:include type="megamenu" name="the_menu_type" menutype="the_menu_type" />

    And yes, you still can use the markup above to render the module.

    This require some knowledge about PHP and Joomla to implement a module.
    Though, it is easy to do. And you can hire a developer to help you.

    Regards

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

This topic contains 7 replies, has 3 voices, and was last updated by  Wall Crasher 11 years ago.

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