Problem/Motivation
We currently have hard-coded hacks like this in MenuForm
:
elseif (($url = $link->getUrlObject()) && $url->isRouted() && $url->getRouteName() == 'user.page') {
$form[$id]['title']['#suffix'] = ' (' . $this->t('logged in users only') . ')';
}
This means contrib/custom menu links aren't able to do this without some heaving form altering.
See #2503755-86: Switch from user login block to login menu link and search block in standard profile and #2503755-87: Switch from user login block to login menu link and search block in standard profile.2.
Proposed resolution
Allow menu link plugins to specify admin labels.
Remaining tasks
TBD
User interface changes
None.
API changes
API addition.
Data model changes
None.