-
AuthorPosts
-
islandview Friend
islandview
- Join date:
- December 2007
- Posts:
- 126
- Downloads:
- 8
- Uploads:
- 11
- Thanks:
- 24
- Thanked:
- 3 times in 2 posts
November 29, 2008 at 12:42 pm #135803This should be easy – but I can’t crac k it…..
How do I set things so my main navigation menu just shows the top level of menu items and no mouseover dropdowns of child menus?????
Can anyone rescue me with this one!?!?!
Anonymous ModeratorJA Developer
- Join date:
- September 2014
- Posts:
- 9914
- Downloads:
- 207
- Uploads:
- 152
- Thanks:
- 1789
- Thanked:
- 2008 times in 1700 posts
December 3, 2008 at 10:31 am #281122Dear acbonner,
Please open Moomenu.class.php file in templates/ja_edenite/ja_menus folder, change functions according to following script:
[PHP]function beginMenuItems($pid=0, $level=0){
//echo ‘fdsfdsfsd’;
if($level==0) echo “<ul id=”ja-cssmenu” class=”clearfix”>n”;
//else echo “<ul>”;
}
[/PHP]
[PHP]
function endMenuItems($pid=0, $level=0){
if($level==0) echo “</ul>n”;
//else echo “</ul>”;
}[/PHP][PHP]function genMenuItem($item, $level = 0, $pos = ”, $ret = 0) {
//if ($level) return parent::genMenuItem($item, $level, ”, $ret);
//else
if($level == 0) {
return parent::genMenuItem($item, $level, $pos, $ret);
}
}[/PHP]1 user says Thank You to JA Developer for this useful post
islandview Friendislandview
- Join date:
- December 2007
- Posts:
- 126
- Downloads:
- 8
- Uploads:
- 11
- Thanks:
- 24
- Thanked:
- 3 times in 2 posts
December 7, 2008 at 4:34 pm #281643Hi there – The code you provided to hide the sub-menus worked fine BUT it does create an odd little graphical glitch – see image below.
For every active sub-menu, a tiny horizontal line appears to the right of the main parent – with many sub-menus this grows and grows!! :((
Looking at the page code I think it’s because the system is still generating a <li></li> type entry for every item.
Anyway to stop this happening please?
Thanks!
Anonymous ModeratorJA Developer
- Join date:
- September 2014
- Posts:
- 9914
- Downloads:
- 207
- Uploads:
- 152
- Thanks:
- 1789
- Thanked:
- 2008 times in 1700 posts
December 8, 2008 at 7:32 am #281718Dear acbonner,
Please try to change two function beginMenuItem, endMenuItem to:
[PHP]function beginMenuItem($row=null, $level = 0, $pos = ”) {
$active = in_array($row->id, $this->open);
$active = ($active) ? ” active” : “”;
//if ($level == 0 && @$this->children[$row->id]) echo “<li class=”havechild{$active}”>”;
//else if ($level > 0 && @$this->children[$row->id]) echo “<li class=”havesubchild{$active}”>”;
echo “<li “.(($active) ? “class=”active”” : “”).”>”;
}
function endMenuItem($mitem=null, $level = 0, $pos = ”){
if($level == 0) {
echo “</li> n”;
}
}[/PHP]Hope it helps.
islandview Friendislandview
- Join date:
- December 2007
- Posts:
- 126
- Downloads:
- 8
- Uploads:
- 11
- Thanks:
- 24
- Thanked:
- 3 times in 2 posts
December 8, 2008 at 11:56 am #281758Sadly still getting the same issue even when using your code above. I’ve refreshed cache and everything like that.
When I’ve got 2 sub-menus active, the HTML generated using your latest code tweaks is…..
<li ><a href=”/healthandfitness” class=”menu-item2″ id=”menu41″ title=”Health”><span class=”menu-title”>Health</span></a><li ><li ></li>
So it’s throwing the extra <li >’s in there still…..
Any ideas? Thanks
Anonymous ModeratorJA Developer
- Join date:
- September 2014
- Posts:
- 9914
- Downloads:
- 207
- Uploads:
- 152
- Thanks:
- 1789
- Thanked:
- 2008 times in 1700 posts
December 9, 2008 at 4:37 am #281856Please change following script:
[PHP]function beginMenuItem($row=null, $level = 0, $pos = ”) {
$active = in_array($row->id, $this->open);
$active = ($active) ? ” active” : “”;
//if ($level == 0 && @$this->children[$row->id]) echo “<li class=”havechild{$active}”>”;
//else if ($level > 0 && @$this->children[$row->id]) echo “<li class=”havesubchild{$active}”>”;
echo “<li “.(($active) ? “class=”active”” : “”).”>”;
}[/PHP]To
[PHP]function beginMenuItem($row=null, $level = 0, $pos = ”) {
$active = in_array($row->id, $this->open);
$active = ($active) ? ” active” : “”;
//if ($level == 0 && @$this->children[$row->id]) echo “<li class=”havechild{$active}”>”;
//else if ($level > 0 && @$this->children[$row->id]) echo “<li class=”havesubchild{$active}”>”;
if($level == 0) {
echo “<li “.(($active) ? “class=”active”” : “”).”>”;
}
}[/PHP]jay973 Friendjay973
- Join date:
- October 2008
- Posts:
- 401
- Downloads:
- 0
- Uploads:
- 12
- Thanks:
- 28
- Thanked:
- 105 times in 68 posts
December 9, 2008 at 7:00 am #281884Or you could just set the menu style to either split menu or dropline menu in the template manager.
Hope this helps.
Cheers,
Jason.islandview Friendislandview
- Join date:
- December 2007
- Posts:
- 126
- Downloads:
- 8
- Uploads:
- 11
- Thanks:
- 24
- Thanked:
- 3 times in 2 posts
December 9, 2008 at 6:23 pm #282034Thanks so much – This code is working as intended for me – Everything is working now. Thanks so much. 😀
AuthorPostsViewing 8 posts - 1 through 8 (of 8 total)This topic contains 8 replies, has 3 voices, and was last updated by islandview 15 years, 11 months ago.
We moved to new unified forum. Please post all new support queries in our New Forum
Removing Menu DropDown Display
Viewing 8 posts - 1 through 8 (of 8 total)