-
AuthorPosts
-
July 16, 2010 at 11:56 am #152596
Is possible use more than one MegaMenu in one page?
Like one in header and other in main content…palcaraz Friendpalcaraz
- Join date:
- September 2010
- Posts:
- 5
- Downloads:
- 0
- Uploads:
- 0
- Thanked:
- 1 times in 1 posts
September 29, 2010 at 9:38 pm #357114I have the same question.
If you can not use megamenu several times, what other component can be recommended?
Thanks
Pedro AlcarazSherlock FriendSherlock
- Join date:
- September 2014
- Posts:
- 11453
- Downloads:
- 0
- Uploads:
- 88
- Thanks:
- 221
- Thanked:
- 2478 times in 2162 posts
September 30, 2010 at 7:12 am #357148Dear 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 !
1 user says Thank You to Sherlock for this useful post
September 30, 2010 at 12:03 pm #357188This 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 Friendpalcaraz
- Join date:
- September 2010
- Posts:
- 5
- Downloads:
- 0
- Uploads:
- 0
- Thanked:
- 1 times in 1 posts
September 30, 2010 at 10:34 pm #357253The 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 FriendSherlock
- Join date:
- September 2014
- Posts:
- 11453
- Downloads:
- 0
- Uploads:
- 88
- Thanks:
- 221
- Thanked:
- 2478 times in 2162 posts
October 2, 2010 at 1:30 am #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 Friendmicker
- Join date:
- March 2006
- Posts:
- 131
- Downloads:
- 1
- Uploads:
- 3
- Thanks:
- 9
- Thanked:
- 4 times in 1 posts
November 22, 2010 at 11:55 am #363716hello it possible to load an other menu in this other ja-megamenu ?
how to on ja purity 2 ?
Thanks for allSherlock FriendSherlock
- Join date:
- September 2014
- Posts:
- 11453
- Downloads:
- 0
- Uploads:
- 88
- Thanks:
- 221
- Thanked:
- 2478 times in 2162 posts
November 22, 2010 at 1:20 pm #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 !
March 2, 2011 at 9:33 am #379258Hi everyone! I have a question….for duplicate the megamenu in J1.6?
dunglq Frienddunglq
- Join date:
- March 2010
- Posts:
- 108
- Downloads:
- 0
- Uploads:
- 0
- Thanks:
- 6
- Thanked:
- 12 times in 13 posts
March 3, 2011 at 8:52 am #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;?>
-
AuthorPosts
This topic contains 10 replies, has 6 voices, and was last updated by dunglq 13 years, 8 months ago.
We moved to new unified forum. Please post all new support queries in our New Forum