WebsiteBaker Support (2.8.x) > Templates, Menus & Design
How do you make the parent menu unclickable? <SOLVED>
Stefek:
Does your menu work this way at all? :-D
OK, here is a link for study for you.
http://code.jellycan.com/files/show_menu2-README.txt
And here is the code for the $aItemOpen parameter:
'[ li][if(level==0){<span>[menu_title]</span>}else{<a href="[url]"><span>[menu_title]</span></a>}]'
all together your show_menu2 parameter call should look like this:
[/list]
--- Code: --- <?php
show_menu2(0, SM2_ROOT, SM2_ALL, SM2_ALL,
'[li][if(LEVEL==0){<span>[menu_title]</span>}else{<a href="[url]"><span>[menu_title]</span></a>}]', //$aItemOpen
"\n</li>",
false,
false,
false,
'<ul id="header_menu" class="menu">');
?>
--- End code ---
Also look at this example on the linked page (above link):
--- Code: ---<?php
show_menu2(
$aMenu = 0,
$aStart = SM2_ROOT,
$aMaxLevel = SM2_CURR+1,
$aOptions = SM2_TRIM,
/* the next two lines have to do with the LINKS */
$aItemOpen = '[li][a][menu_title]</a>',
$aItemClose = '</li>',
/* the next two lines have to do with the Menu and Submenu Structure*/
$aMenuOpen = '[ul]',
$aMenuClose = '</ul>',
$aTopItemOpen = false,
$aTopMenuOpen = false
);
?>
--- End code ---
Regards and lots of fun!
Stefek
Argos:
--- Quote from: tsb on January 16, 2010, 07:44:57 PM ---I basically made a parent page, type as a menu link, then put in the menu link,
link: external link > then I put in the websites home page.
This allows you to still have a drop down menu with the links but having the parent as a link to main-site and not opening up a new page, which I wanted to happen.
--- End quote ---
That's unlogical and not user friendly. Clicking on a parent menu item brings you back to the homepage? That will feel like a bug to users. You should link to the first child page, or use stefeks info above.
tsb:
I had a go with the showmenus item open, yet Im using the css2 dropdown menu, and it doesnt seem to bring that element in when I put it into the templates index.php
Im not a very logical person :-) more used to the creative side of things, so struggling to find the method with css and the functions in showmenu. I might link to the first child page that you mentioned.
Thanks for all the feedback and possibilities,
cheers,
Stefek:
--- Quote from: tsb on January 17, 2010, 09:30:18 PM ---it doesnt seem to bring that element in when I put it into the templates index.php
--- End quote ---
:-)
Oh yes, the CSS is another side if the menu.
But did you try the code? And was your Items unclickable then?
Regards,
Stefek
tsb:
sorry Stefan, I couldn't get it to work in my index.php file.
The menu in allcss2 template just breaks the dropdown menu, when I tried out both of the codes.
Im just not up on the coding side. cheers,
Navigation
[0] Message Index
[#] Next page
[*] Previous page
Go to full version