Created
February 24, 2014 15:14
-
-
Save ChezFre/9190143 to your computer and use it in GitHub Desktop.
Allow adding links to your navigation that have no path.
- Use the value 'nolink' as href attribute.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| function YOURTHEMENAME_menu_link(array $variables) { | |
| $element = $variables['element']; | |
| $sub_menu = ''; | |
| if ($element['#below']) { | |
| $sub_menu = drupal_render($element['#below']); | |
| } | |
| if (strpos( $element['#href'], 'nolink')) { | |
| $output = '<a href="#" class="nolink">' . $element['#title'] . '</a>'; | |
| } else { | |
| $output = l($element['#title'], $element['#href'], $element['#localized_options']); | |
| } | |
| return '<li' . drupal_attributes($element['#attributes']) . '>' . $output . $sub_menu . "</li>\n"; | |
| } | |
| ?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment