How to add a hash or nolink in menus in drupal

Usage: Let you have a parent menu named Services. Under services there are 2 submenus services1 & services2. If  there is no need to give path to services then you can use <nolink> in path. But you have to make some css changes.

Step1:Download special_menu_items  module & enable it.

Step2: Go to structure->menus->Main Menus->List Links.

Step3: Then add/edit the menu you want to give nolink or #.

nolink

Step4:Save.

Step5: Copy your css codes of menus & paste it. For ul.menu a add css ul.menu span.nolink. and paste the css properties inside this class.

Add some css like following :

menu css of your website:

.menu li a{font-size:16px; display:block; color:#fff; line-height:94px;text-transform: uppercase; margin:0 5px 0 5px; }

Add the following for nolink

.menu li span.nolink{font-size:16px; display:block; color:#fff; line-height:94px;text-transform: uppercase; margin:0 5px 0 5px; }

Step6: Now check your menus. it will work fine.

Leave a Reply

Your email address will not be published. Required fields are marked *

fourteen + 18 =