due to this issue #865892: Menu items that are not links there has been a patch applied to the megamenu that fixes "nolink" issue but does not handle it properly

why not properly ?
the way nolink is handled now is just a very plain vanilla functionality with no compatibility for other modules such as menu_attributes which according to the maintainer is a major feature (http://drupal.org/node/799280#comment-4444674)to be added

just deleting the "nolink" extra handling code

            if ($leaf['link']['router_path'] == 'nolink') {
              $link_data = '<span class="nolink">' . $leaf['link']['link_title'] . '</span>';
            }
            else {
              $link_data = l($leaf['link']['link_title'], $leaf['link']['href'], $leaf_link_options);
            }

making this

              $link_data = l($leaf['link']['link_title'], $leaf['link']['href'], $leaf_link_options);

and installing the http://drupal.org/project/special_menu_items and we still get the "nolink" functionality and together with the patch provided on #799280: Ability to inject custom css classes into each level of the menu - menu attributes compatibility all other attributes should be carried over to the menu items

I can provide a patch after maintainers approval and/or commiting of the above issue

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

Anonymous’s picture

Anonymous’s picture

For some reason, special menu items didn't work before I added the if case for it... But if it works now without it, then I like this approach.

GiorgosK’s picture

if you ask me all nolink custom code should be dropped if possible

geek-merlin’s picture

sub.
i'm running a patch here which solves the issue (and #1078694: Mega menu doesn't allow query strings in menu paths) by calling theme_meju_link.
i'll run sume tests and then post it.

geek-merlin’s picture

Version: 6.x-2.x-dev » 7.x-1.x-dev
Status: Active » Needs review
FileSize
6.19 KB

this patch works fine on our 7.x sites.
it uses theme_menu_link to render links so has good chances to play fine with *any* module that hooks in there.
it really hurted to work around the current api "flaw" that theme_menu_link wraps the a tag in a li element, and that the current js needs "h2" and "h3" elements around the a tag.

for me it's a lolution-for-now until the rewrite.

what we get for free with this patch is a fix for #1078694: Mega menu doesn't allow query strings in menu paths

wizian’s picture

This patch works nicely for me (D7.2) using the nolink tag. Thanks a lot Axel.

alexbk66-’s picture

Anonymous’s picture

Rerolled patch to work against 7.x-1.x-dev with drush make

patcon’s picture

Rerolled patch in #5 against current HEAD (commit hash 2b1f274) so that it will work with drush_make. This replaces the patch in the message immedaitely previous :)

mherchel’s picture

#9 failed to patch, giving the error:
fatal: git diff header lacks filename information when removing 1 leading pathname component (line 5)

#8 did apply the patch, but gave some trailing whitespace messages. It did fix the problem, though :)

$ git apply 1170472-use-theme_megamenu-render-menu-links.patch
1170472-use-theme_megamenu-render-menu-links.patch:15: space before tab in indent.
                $leaf_item_options  = array(
1170472-use-theme_megamenu-render-menu-links.patch:25: trailing whitespace.

1170472-use-theme_megamenu-render-menu-links.patch:66: trailing whitespace.

1170472-use-theme_megamenu-render-menu-links.patch:99: trailing whitespace.

1170472-use-theme_megamenu-render-menu-links.patch:117: trailing whitespace.
 *
warning: 5 lines add whitespace errors.