Orchard Navigation - how to make a menu link non-interactive

I have the following menu navigation:

home
product
     product 1
     product 2
news
     press releases
about us

Each menu item above refers to Content, with the exception of a “product”. I need to do this when the user clicks "product" will not go anywhere.

I tried using the "User Link" and entered "#" or "javascript: void (0)" in the URL, however this does not work, since Orchard always prefixes url with "/".

In addition, I tried using the “Html menu item” and injecting the “product” into the html body, but always displayed as

<li><span class="raw"><p>product</p></span><ul>...</ul></li>

I want either the following:

<li><a href="#">product</a><ul>....</ul></li>

or

<li>product<ul>....</ul></li>

Is there an easy way to do this?

+4
source share
2 answers

Menu.cshtml Core->Shapes->Views Orchard.Web :

$(document).ready(function () {
    $("#Nav a").click(function(e) {
        e.preventDefault();
    });
});

, , :

$('#Nav li ul li a').click(function(e){
     e.preventDefault();
});

Menu.cshtml , . .

+4

, , Menu.cshtml . .

+3

All Articles