- Issue created by @m4olivei
- 🇨🇦Canada SKAUGHT
Navigation project goals include: ✨ Add the user image to the user menu when available Active
How User menu is made: User menu is provided by a Menu Plugin (YAML FORMAT)
https://git.drupalcode.org/project/drupal/-/blob/11.x/core/modules/user/...user login/logout item:
https://git.drupalcode.org/project/drupal/-/blob/11.x/core/modules/user/...
items itself dynamically changes title & path. cache content 'user.roles:authenticated'----
Perhaps it's simply that using the same namespace 'user' should be renamed to keep more separation for when a site may want to place the traditional list of Account Items?#[NavigationBlock( id: 'user', admin_label: new TranslatableMarkup('User'), )]
- 🇬🇧United Kingdom catch
If this needs to be different to the user account menu that would normally be in the front end theme (brought up by @ckrina on the MR), then it might also be possible to define an additional menu like 'Navigation user links' so that they're separate - but that would still allow people to add an extra link or remove something if they want to.
- 🇪🇸Spain ckrina Barcelona
Agreed. I missed the part about customizing the links. Tagging this as Stable Blocker.
- 🇬🇧United Kingdom AaronMcHale Edinburgh, Scotland
Having the "User account menu" and the user account links that appear in the toolbar being different does feel like a weird quirk, from a UX perspective I think using the "User account menu" and "modernizing" it makes a lot of sense. As noted, it also allows the user menu links in the toolbar to be customized, which is a win in my opinion. I think it would be weird if every other menu in the Navigation could be customized apart from the user links.
- 🇬🇧United Kingdom catch
There are sites that customize the user account menu links with links that they might not want in the navigation toolbar, however, if it's just a menu block in the layout, those sites could swap it out with a different menu block easily enough. So using the same block by default might be plenty?
- 🇬🇧United Kingdom AaronMcHale Edinburgh, Scotland
however, if it's just a menu block in the layout, those sites could swap it out with a different menu block easily enough. So using the same block by default might be plenty?
Agreed. We should think in terms of what's the most sensible default for the 89% use-case. As you say, they can always use a different menu on the front-end, or swap this one out for a different one in the navigation.
- 🇪🇸Spain plopesc Valladolid
Adding 📌 Agree on a lazy load strategy Active as reference to deal with caching at user level issues.
My concern or question about how to integrate a menu here is because most of the links I think that could be added to this menu are user specific, like
/user/XX/foo
and I am not sure how we could handle routes like that from a menu.Mostly thinking about menu links created from the UI by site admins, where it is not possible to indicate URL parameters.
Core's user routes provides shortcuts like /user or /user/edit that redirects to the user specific page, but that's something not all the contrib modules that provide user specific routes or views that use the user ID as parameter would support.
We could encourage the usage of modules like https://www.drupal.org/project/user_current_paths → or https://www.drupal.org/project/me_redirect → for this menu, though.