Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[UX] Menu link items should be kept in sync with their respective content titles #4759

Open
klonos opened this issue Nov 13, 2020 · 8 comments

Comments

@klonos
Copy link
Member

klonos commented Nov 13, 2020

This happens for content types that have the "Add a link into the menu for new content of this type" option enabled (menu settings):

  1. Vanilla Backdrop installation
  2. Create a page, with it's title set as "Page", and save -> a "Page" menu item is added to the main navigation menu of the site 👍
  3. Edit the "Page" page, change it's title to "Renamed page", and save ->

Actual behavior

  • The page gets renamed to "Renamed page", but the respective menu item remains "Page"

    image

  • If you edit the page, the breadcrumb shows the old name (expected, since breadcrumbs pick parts from the menu items), which is confusing:

    image

Expected behavior

Things work the same way as the "Generate automatic URL alias" checkbox works (pathauto "persist" feature):

  • When the "Provide a menu link" option is enabled for the node, there is another "Update menu title when the content title changes" checkbox. When that second checkbox is ticked, the "Menu link title" field is disabled:
    image

  • The menu item title is synced with the content title. Renaming the content also renames the menu item.

  • If the user wants to "break the sync" between the menu item title and the content title, they need to untick that second checkbox.

Alternatives

  • When the "Provide a menu link" option is enabled for a node, there is an info message shown, which explains that changing the content title will not automatically update the respective menu item in the navigation menu.
  • When the "Provide a menu link" option is enabled for a node, there is a checkbox under the node title field, called "Also update the menu title":

image

@klonos
Copy link
Member Author

klonos commented Nov 13, 2020

...I wasn't sure if this is a feature or a bug, but the behavior as it currently is feels like a UX WFT to me, so I've tagged this as a bug for now.

@indigoxela
Copy link
Member

...I wasn't sure if this is a feature or a bug, but the behavior as it currently is feels like a UX WFT to me

I get your point, but a word of warning here: I'd not recommend to force content title and menu item to be synced. Often they differ by intention. And I'm not sure if the same logic as in pathauto should get applied. This might need more feedback.

And it's not a bug. 😉

@klonos
Copy link
Member Author

klonos commented Nov 14, 2020

And I'm not sure if the same logic as in pathauto should get applied.

In Backdrop, we've included the functionality of https://www.drupal.org/project/pathauto_persist (which is what I'm suggesting we do here as well). Try the following:

  1. Create a post -> give it a title of "A blog post" -> leave all settings as default (notice in the "URL settings" tab that it is set to "Generate automatic URL alias") -> save -> the node is created with posts/a-blog-post as path 👍
  2. Edit the post -> change its title to "Changed blog post" -> leave all other settings as default (notice in the "URL settings" tab that it is still set to "Generate automatic URL alias") -> save -> the path changes to posts/changed-blog-post 👍
  3. Edit the post again -> change its title to "My blog post" -> in the "URL settings" tab untick the "Generate automatic URL alias" checkbox -> leave all other settings as default -> save -> the path remains unchanged posts/changed-blog-post 👍
  4. Edit the post again -> do not change its title -> in the "URL settings" tab leave the "Generate automatic URL alias" checkbox unticked -> change the path to whatever (blah/blah/blah for example) -> leave all other settings as default -> save -> the path is now blah/blah/blah 👍
  5. Edit the post a last time -> do not change its title -> in the "URL settings" tab enable "Generate automatic URL alias" -> leave all other settings as default -> save -> the path is now posts/my-blog-post 👍

I'd not recommend to force content title and menu item to be synced. Often they differ by intention.

What I'm proposing is to basically allow the same flexibility with menu items linked to content. The way this will work will cover both cases of keeping the menu in sync or not. Consider these scenarios:

  1. Novice user, all they want is to create a page, and when it gets created, it should have an automatic path and also an automatic menu item in the main navigation menu:

    • Create a page -> add "About us" as title -> save -> the page is created with path about-us, and a menu item also called "About us".

    This user does not know how paths and menu items work in Backdrop - since these were created automatically when they created the content (when all they did was to add a title for it), the expectation is that when the content title changes, the automatically-generated things get updated as well:

    • Edit the page -> change the title to "About" -> save -> the page is updated, its path changes to about, and the respective menu item also changes to "About".
  2. Advanced user, who is SEO-cautious and wants more control over their content and its metadata:

    • Create a page -> add "About our awesome company" as title -> untick the "Generate automatic URL alias" option, and manually change the path to about -> untick the "Update menu title when the content title changes" checkbox, and manually specify the menu link title as "About us" -> save -> the page is created with:
      • "About our awesome company" as title
      • about as path
      • "About us" as the menu item

    Each time this advanced user edits this piece of content, they know that they need to manually update all 3 items manually/independently (title/path/menu).

@ghost
Copy link

ghost commented Nov 15, 2020

I agree that this can be annoying for some users, while others expect it to work this way. I support giving users a choice as to whether or not titles/menu items are synced on a per-node basis. I like @klonos' "expected behaviour" scenario.

I also agree with @indigoxela that this isn't a bug, its by design (its just a bad design for some users). So this should be a feature request to make that 'design' optional.

@klonos
Copy link
Member Author

klonos commented Nov 15, 2020

I also agree with @indigoxela that this isn't a bug

Fair enough 👍

@indigoxela
Copy link
Member

Many thanks for the detailed example. Makes sense.

Another question: what if the acting user does not have permission to add a menu item. Should the menu item still get created / synced then? I'm thinking of the contrib module auto_menu_settings, which provides automatic menu items for less privileged users and also can hide all the settings.

But maybe that's going beyond the purpose of this issue. 😉

@klonos
Copy link
Member Author

klonos commented Nov 17, 2020

But maybe that's going beyond the purpose of this issue. 😉

It is, but this has been raised before. Not sure if we have just discussed it during a meeting, or in #1610, can't find an issue for it 🤔

@klonos
Copy link
Member Author

klonos commented Nov 17, 2020

...aha: #901

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants