test
Viewing 10 posts - 1 through 10 (of 10 total)
  • Author
    Posts
  • pwmpro Friend
    #152596

    Is possible use more than one MegaMenu in one page?
    Like one in header and other in main content…

    palcaraz Friend
    #357114

    I have the same question.

    If you can not use megamenu several times, what other component can be recommended?

    Thanks
    Pedro Alcaraz

    Sherlock Friend
    #357148

    Dear palcaraz,

    In this case you can create a new block for this purpose,just try as following
    Creating a new block file under the foder templates/your_template/blocks ,for example the block name mainmega you create the file mainmega.php.

    Opening that file put into it below content

    [PHP]
    if( !class_exits(‘JAMenuMega’)) {
    $file = T3Path::path(T3_CORE).DS.’menu’.DS.”mega.class.php”;
    if (!is_file ($file)) return null;
    require_once ($file);
    }
    $japarams = new JParameter(”);
    $japarams->set( ‘menutype’, ‘topmega’ );
    $japarams->set( ‘menu_images_align’, ‘left’ );
    $japarams->set(‘menu_images’, 1); //0: not show image, 1: show image which set in menu item
    $japarams->set(‘menu_background’, 1); //0: image, 1: background
    $japarams->set(‘mega-colwidth’, 200); //Megamenu only: Default column width
    $japarams->set(‘mega-style’, 1); //Megamenu only: Menu style.
    $jamenu = new JAMenuMega ($japarams);
    //assign template object
    $jamenu->_tmpl = $this;
    //load menu
    $jamenu->loadMenu();
    //check css/js file
    $this->addStylesheet (T3_TEMPLATE.”/css/menu/mega.css”);
    $this->addScript(T3_TEMPLATE.”/js/menu/mega.js”, true);

    ?>

    <div class=”clearfix”>
    <?php if (($jamenu)) $jamenu->genMenu (); ?>
    </div>
    [/PHP]

    Then go to your menu manager create a menu group name topmega with your menu items belong to

    And finally go to the layout setting on your template manager adding the below block tag into the active layout where you want the second mega menu show

    <block name=”mainmega” type=”mainmega” ></block>

    I do hope this will help !

    pwmpro Friend
    #357188

    This work fine…
    So insert this line:
    $japarams->set(‘containerid’, ‘topmega’); //Megamenu only: Container.
    before this line:
    $jamenu = new JAMenuMega ($japarams);

    and change this:
    <div class=”clearfix”>
    <?php if (($jamenu)) $jamenu->genMenu (); ?>
    </div>

    to:
    <div id=”topmega”>
    <div class=”main clearfix”>
    <?php if (($jamenu)) $jamenu->genMenu (); ?>
    </div>
    </div>

    palcaraz Friend
    #357253

    The id=”ja-megamenu” is duplicated.

    In the file mega.class.php the function BeginMenu() write te id=”ja-megamenu” for all megamenus.

    How to avoid?

    Thanks

    Pedro Alcaraz

    Sherlock Friend
    #357409

    <em>@palcaraz 196261 wrote:</em><blockquote>The id=”ja-megamenu” is duplicated.

    In the file mega.class.php the function BeginMenu() write te id=”ja-megamenu” for all megamenus.

    How to avoid?

    Thanks

    Pedro Alcaraz</blockquote>

    Dear palcaraz,

    It is not necessary to care about the id=”ja-megamenu”, when you setted
    $japarams->set(‘containerid’, ‘topmega’); //Megamenu only: Container.
    with a div tag <div id=”topmega”>
    The mega menus will work well,Please check it !

    Moreover, the T3 framework have been upgrading to resolve this problem. We will provide a guide for this issue.

    micker Friend
    #363716

    hello it possible to load an other menu in this other ja-megamenu ?
    how to on ja purity 2 ?
    Thanks for all

    Sherlock Friend
    #363735

    <em>@micker 204657 wrote:</em><blockquote>hello it possible to load an other menu in this other ja-megamenu ?
    how to on ja purity 2 ?
    Thanks for all</blockquote>

    Dear micker,

    I am not much sure when you said “load an other menu in this other ja-megamenu ” ,please explain me more details,also i think that the ja purity 2 is not running the T3V2 Framework !

    nivento Friend
    #379258

    Hi everyone! I have a question….for duplicate the megamenu in J1.6?

    dunglq Friend
    #379443

    <em>@nivento 224918 wrote:</em><blockquote>Hi everyone! I have a question….for duplicate the megamenu in J1.6?</blockquote>

    Hi,

    If you want to use 2 megamenu, you can create 2 menu, one menu is regular megamenu other you can by add new t3 block

    Here is an example (in JA Teline IV) for load megamenu:


    <?php
    //Top navigation - megamenu
    $topmenu = null;
    $topparams = new JParameter('');
    $topparams->set( 'menutype', 'topmega' );
    $topparams->set( 'menu_images_align', 'left' );
    $topparams->set('menu_title', 0);
    $topparams->set('menuname', 'ja-topmega'); //to generate id for this menu

    //$topmenu = $this->loadMenu($topparams, 'mega');
    $file = T3_CORE.DS.'menu'.DS."mega.class.php";
    if (!is_file ($file)) return null;
    require_once ($file);
    $menuclass = "JAMenumega";
    $topmenu = new $menuclass ($topparams);
    //assign template object
    $topmenu->_tmpl = $this;
    //load menu
    $topmenu->loadMenu();
    if($topparams->get('menutype','mainmenu') =='topmega'):
    //check css/js file
    $this->addCSS ('css/menu/mega.css');
    $this->addJS ('js/menu/mega.js');
    ?>
    <?php $this->genBlockBegin ($block) ?>
    <?php //var_dump($topmenu);?>
    <div id="ja-topnav" class="clearfix">
    <?php if (($topmenu)) $topmenu->genMenu (); ?>
    </div>
    <?php $this->genBlockEnd ($block) ?>

    <?php endif;?>

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

This topic contains 10 replies, has 6 voices, and was last updated by  dunglq 13 years, 9 months ago.

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