This PR is one possible way to solve issue #21. In that issue, Special Menu Items in Header block menus incorrectly pointed to </nolink>.
This patch basically does the following:
In the theme registry, it overwrites the function called for theme_links, which is called to theme the links of Header block menus
The replacement function loops through the links in $variable to find any href pointing at <nolink> or <separator>, and it replaces those with the current path
The replacement function then calls the original function for theme_links
Please note: the Special Menu Items in the Header block menu will now point at the current path. Since Special Menu Items don't really have a real href, this is a compromise solution. This means that, when the user clicks on the Special Menu Item in the menu, the current page will be reloaded.
As you may have guessed, it's not a good idea to use menus containing Special Menu Items in the Header Block menu. Those menus are always shown as "1st level" menus, rather than dropdowns. Thus the Special Menu Items serve no function. So, this patch is just a cosmetic solution to avoid showing links to inexistent "nolink" href and avoiding 404s.
Please comment, modify or feel free to ignore this patch, as it really doesn't serve any purpose other than avoiding a 404.
This PR is one possible way to solve issue #21. In that issue, Special Menu Items in Header block menus incorrectly pointed to
</nolink>
.This patch basically does the following:
theme_links
, which is called to theme the links of Header block menus<nolink>
or<separator>
, and it replaces those with the current paththeme_links
Please note: the Special Menu Items in the Header block menu will now point at the current path. Since Special Menu Items don't really have a real href, this is a compromise solution. This means that, when the user clicks on the Special Menu Item in the menu, the current page will be reloaded.
As you may have guessed, it's not a good idea to use menus containing Special Menu Items in the Header Block menu. Those menus are always shown as "1st level" menus, rather than dropdowns. Thus the Special Menu Items serve no function. So, this patch is just a cosmetic solution to avoid showing links to inexistent "nolink" href and avoiding 404s.
Please comment, modify or feel free to ignore this patch, as it really doesn't serve any purpose other than avoiding a 404.