WebsiteBaker Support (2.8.x) > Templates, Menus & Design

How do you make the parent menu unclickable? <SOLVED>

<< < (5/6) > >>

tsb:
Stefek, just getting errors, if I can get this to work, I definitely will put some money towards your way.
I think if I can get the home page to work still then that would be brilliant.

 I could maybe go round the long way and make a link in html, hidding the home page on the menu.
just dont understand how to put the code in to get it to work, sorry.

Argos:
An alternative is to leave the homepage out of the menu by making it hidden (Page Settings > Visibility > Hidden). Then add a manual home link to the menu, like so:


--- Code: ---<ul><li><a href="http://YOURDOMAIN.COM">Home</a></li></ul>
<?php show_menu2(0,SM2_ROOT, 
SM2_ALL, SM2_ALL, 
&#39;[li][if( level == 0 ){<a>[menu_title]</a>}else{<a href="[url]">[menu_title]</a>}]&#39;, 
"\n</li>", 
false, false, false, 
&#39;<ul id="header_menu" class="menu">&#39;
);         
?>
--- End code ---

You may have to style the URL of the Home button to match the rest of the menu.

Stefek:

--- Quote from: tsb on May 25, 2010, 08:49:13 PM ---Stefek, just getting errors, if I can get this to work, I definitely will put some money towards your way.

--- End quote ---

Hello,
if you really want to spent some bucks, then I always love to get PHP Books in exchange for my time ;-)
Amazon makes it possible.

But first, let's try to get the menu to work.

The following code should work properly:

--- Code: ---<?php    
    show_menu2(
        0,SM2_ROOT, SM2_ALL, SM2_ALL, 
        &#39;[li]
        [if(level != 0 || id == 777){ 
        <a href="[url]">[menu_title]</a>
        }                     
        else{
        <a>[menu_title]</a>
        }]&#39;, 
        &#39;</li>&#39;, 
        false, 
        false, 
        false, 
        &#39;<ul id="header_menu" class="menu">&#39;
    );         
?>

--- End code ---
Please try it, and let me know how it works.

You will need to replace 777 by the pageID of 'home'.

Kind regards,
Stefek

tsb:
that works a treat,
just give me a php book title :) and your address via message.
get it posted by the end of the week hopefully (I hope it aint too pricey mind),
very much appreciate everyones help in the coding part 8-)

thanks again

Stefek:

--- Quote from: tsb on May 25, 2010, 11:27:54 PM ---that works a treat,
just give me a php book title :) and your address via message.
get it posted by the end of the week hopefully (I hope it aint too pricey mind),

--- End quote ---

Hello TSB,
thanks for being willing to give something for something.
Give & Take is a essential foundation of any community.

I found something not too pricey.
You got PM.

Kind regards,
Stefek


Navigation

[0] Message Index

[#] Next page

[*] Previous page

Go to full version