backdrop-contrib / special_menu_items

Enables creating placeholder and separator menu items.
GNU General Public License v2.0
2 stars 3 forks source link

Implements a link replacement for Header Block menus #24

Open argiepiano opened 3 years ago

argiepiano commented 3 years ago

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:

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.

argiepiano commented 3 years ago

Important: after applying this patch, you MUST clear the cache, so that the function special_menu_items_theme_registry_alter() is run.