Score:1

How do I add items from from the user module to a menu?

km flag

How do I add the core user module links such as My account and Log out to another menu?

Score:1
cn flag

The My Account and Log Out links are defined in core/modules/user/user.links.menu.yml

user.page:
  title: 'My account'
  weight: -10
  route_name: user.page
  menu_name: account
user.logout:
  weight: 10
  menu_name: account
  class: Drupal\user\Plugin\Menu\LoginLogoutMenuLink

As you can see they are hardcoded to the account menu. With this in mind, really the best thing to do is simply place both menus next to each other on the Block Overview page. This works for probably 95% of use cases. Your CSS should be written in a way to support that. For the other 5%, you could go as far as to piggyback your own links in a custom module. If you were to do so, it would/could look something like this:

my_module.info.yml

type: module
name: 'My Module'
description: 'Copy user links.'
core_version_requirement: ^8.8 || ^9
package: 'User'
dependencies:
  - user:user

my_module.links.yml

my_module.user_page:
  title: 'My account'
  weight: -10
  route_name: user.page
  menu_name: YOUR_MENU_ID
my_module.user_logout:
  weight: 10
  menu_name: YOUR_MENU_ID
  class: Drupal\user\Plugin\Menu\LoginLogoutMenuLink
mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.