Hello all,
based on some conditions i want to hide a few links from primary link. How can i accomplish it. I have searched a lot on this forum but could not find the appropriate thread.

Thanks

Comments

zbricoleur’s picture

It would probably help if you spelled out the conditions. There is more than one way of doing it, and how you do it will depend on what exactly you want to do.

Most likely, though, you will use the theme_menu_item function to add a CSS class to the links you want to hide, and then apply the display: none property to that class. Copy the theme_menu_item function from includes/menu.inc into your theme folder and rename it "phptemplate_menu_item." Refresh your database cache. The "new" function will now override the default behavior.

Syed_Shah’s picture

I have a separate page for login, and have added the path to it in the primary links. I have formated that page according to my own needs, so i dont want to use user/login, and i have made my own login page. I want that when the user logs in, the login link from the primary menu should hide.

Thanks

zbricoleur’s picture

There's no login link in the primary links menu unless you put it there. Are you sure you don't mean the navigation menu?

Just hide the navigation menu altogether (admin/build/menu/settings or admin/build/block, depending on how you want to do it), and put only the links you want to show in primary links, and show that instead.

canyonbreeze’s picture

http://drupal.org/project/menu_per_role

This will let you set access to menu items by role, eg only admin can see etc.

see15_aug’s picture

I want to hide a link that will display when a user logined else it will disappear what should i do?

my site have links-
Home
Companies
Consultant
Favorite companies
Favorite consultants
Login

I want to hide "Favorite companies" and "Favorite consultants". When a user will login "Favorite companies" and "Favorite consultants" links will appear.

I am using nicemenu.

Help please....