Open klonos opened 8 years ago
I often open many edit/add link tabs in my browser and it is really hard to find the right one. This is annoying. Can we set a milestone please?
Simple PR fixes this.
The PR fixes the main issue by getting it to display Add Link as title and gets rid of the tabs.
Using the sandbox site, this looks to have the side-effect of removing the link to add a link while viewing the menu individually:
Links can still be added by going to the listing of menus, then using the dropbutton next the menu to add a link.
It also removes the link to add a new menu entirely:
Though you can add a new link via the Admin Bar.
I think I'd be more comfortable with adding a backdrop_set_title()
in the menu callbacks. Or ideally we'd fix the way titles are displayed when using action links. Right now action links everywhere do this weird behavior of using their parent menu item as the page title.
I filed a new PR at https://github.com/backdrop/backdrop/pull/2097 that should fix the display of action links throughout Backdrop, and the titles for adding a menu or menu link specifically.
The first fix is simple: let menu_get_active_title()
return the action link title instead of using the parent item title.
However, after fixing that, it appears as though we have some cruft from the Drupal 6 era in menu module that manually creates individual menu links for each created menu. I couldn't see any reason for this, as we don't do this with any other menu links that contain wildcards (e.g. editing content types, vocabularies, layouts, views, etc.) I think it's simply code that had been ported forward because no one really understood what it did.
So this PR removes that cruft (the entire menu_enable()
function), cleans up the database menu_links table, and also switches the title that is used when on a page created by a local action link.
Good catch with the disappeared action links! The sandbox site of the new PR works as expected: You can add menus and links again using the action links; the title of these pages are "Add menu" and "Add link" respectively.
Compared to the former PR, the two inactive tabs on the Add link page are still visible.
Compared to the former PR, the two inactive tabs on the Add link page are still visible.
If we're going to change that, we'd need to come up with something global. This happens for all pages where there are both local tasks (tabs) and local actions (the "+ Add [whatever]" links). You can see this same thing on admin/structure/layouts/add
, admin/structure/views/add
, admin/config/urls/path/add
, admin/config/urls/redirect/add
, and probably other places. So perhaps we save that for a different issue.
I updated the PR a bit to also remove unnecessary backdrop_set_title()
calls elsewhere. Now that action links use their own link title as the page title, we can remove calls to backdrop_set_title()
when adding a block, text editor, layout, block, or view.
Closed my PR (https://github.com/backdrop/backdrop/pull/2088) in favour of https://github.com/backdrop/backdrop/pull/2097
...this needs a rebase and some conflicts resolution.
Bumped into this again while working on #6578, where the page title for admin/structure/file-types/add
is "File types" instead of "Add file type" 👎🏼 ...and is showing the horizontal tabs 👎🏼 :
I'm looping back to this to get it out of the way.
...and is showing the horizontal tabs 👎🏼 :
That is intentional after all - I just thought that it was random because I couldn't figure out the logic. So lets address just the titles issue here, and decide if hiding the tabs is a good thing or a bad thing UX-wise in a separate issue: #6579
OK, PR ready for review: https://github.com/backdrop/backdrop/pull/4770
@klonos This needs a rebase. No available sandbox.
@stpaultim I rebased it.
admin/structure/menu/add
) has "Menus" as title - should be something like "Add menu".admin/structure/menu/manage/[menu-name]/add
) has a "[Menu name]" title - should be something like "[Menu name]: Add link". That page has two inactive tabs: "List links" and "Edit menu". We should lose these from the add link page to be in tandem with the link edit page. The way it is now is weird:The menu link edit page does not have these two tabs and the page title is ok ("Edit menu link"):
...although, it would be better IMO to have it be "Edit menu link [menu_link_title]" instead in order to differentiate in case one has multiple tabs open in their browser.
~PR by @BWPanda: https://github.com/backdrop/backdrop/pull/2088~ PR by @quicksketch: https://github.com/backdrop/backdrop/pull/2097