Make WordPress Core

Opened 4 years ago

Last modified 6 months ago

#13273 new enhancement

Allow "'non-clickable" menu items

Reported by: stgoos Owned by:
Milestone: Future Release Priority: normal
Severity: minor Version:
Component: Menus Keywords: menu non-clickable item
Focuses: Cc:


In the new menu generator I'm missing the option to create "non-clickable" menu items.

What I'm after is that I want to create for example a main menu item with the title "Links" which is non-clickable (no url attached to it) and basically only acts as an umbrella item for the actual links I want to locate as subitems of the item "Links".

  • Home
  • Something else
  • Links (this one should be non-clickable)
    • external link 1
    • external link 2
    • etc

I think that an optional tickbox in the add link section will do the trick. Basically, all it has to do is to "disable" the check whether or not a valid URL format has been submitted and, of course, it has to trigger some modified html output.

Hope you guys can add this in the 3.0 release because this would basically complete the menu generator :)

Keep up the good work and I'm really looking forward to the 3.0 release!

Change History (7)

comment:1 stgoos4 years ago

  • Keywords item added; links removed

comment:2 ryan4 years ago

A workaround for now is to use "#" as the url.

comment:3 ryan4 years ago

  • Milestone changed from 3.0 to 3.1

This won't happen for 3.0.

comment:4 oellefsen4 years ago

Another workaround in 3.0 is to add a custom menu item with a bogus url, and then remove the url, keeping the label, once it's added to the menu structure.

Would be good to have it fixed in the next release, as having a top menu item (with subitems) as links is bad UI design, even for a webpage. I think users do not expext menus to behave like that.

I also really appreciate the new menu builder, it takes a lot of work out of making the site navigation. Thanks for the good work!

comment:5 nacin3 years ago

  • Milestone changed from Awaiting Triage to Future Release

comment:6 Jesper8006 months ago

  • Keywords changed from menu, non-clickable item to menu non-clickable item

There are basically two approaches to this as far as the outputted HTML is concerned.

The first option is to output an anchor tag without the href-attribute. This is what already happens when you add a custom link and remove the URL, as oellefsen suggested. The second option is to remove/replace the anchor tag.

The second option will probably cause a lot of problems styling-wise, as a lot of styling is applied on the anchor tags in menus. The first one is the way to go, in my opinion, as it won't cause any of the problems and still have the desired effect.

comment:7 Jesper8006 months ago

  • Cc jeve0@… added
Note: See TracTickets for help on using tickets.