- πΊπΈUnited States mlncn Minneapolis, MN, USA
This is the case for any module-provided, any code/config provided menu item, as opposed to menu links (content).
This does need to be better documented on the user page.
And of course it would be great if we could add attributes to these machine-provided menu items.
A workaround is to create a custom menu link through the interface that links to your view, but is not itself provided by the view.
Igor Mashevskyi β made their first commit to this issueβs fork.
- Merge request !9Issue #3323993: No options for view menu items β (Open) created by igor mashevskyi
- Status changed to Needs review
over 1 year ago 1:17pm 29 March 2023 - Status changed to Needs work
about 1 year ago 2:41pm 11 October 2023 - π§πͺBelgium rgeerolf Belgium π§πͺπͺπΊ
I tried the MR against 1.3 and the latest dev and I got an error when I tried to edit the menu link.
TypeError: _menu_link_attributes_add_attributes(): Argument #2 ($menu_link_options) must be of type array, null given, called in /var/www/html/web/modules/contrib/menu_link_attributes/src/Plugin/Menu/Form/ViewsMenuLinkWithAttrForm.php on line 19 in _menu_link_attributes_add_attributes() (line 46 of modules/contrib/menu_link_attributes/menu_link_attributes.module).
- last update
8 months ago Composer require failure - Status changed to Needs review
8 months ago 8:51am 26 March 2024 - Status changed to Needs work
6 months ago 9:20am 14 May 2024 - π©πͺGermany Anybody Porta Westfalica
@Igor Mashevskyi any plans to finish this?
- Status changed to Needs review
2 months ago 1:36pm 18 September 2024 @anybody I've resolved the merge error, so MR is mergeable now
- Status changed to Needs work
2 months ago 6:15am 19 September 2024 - π©πͺGermany Anybody Porta Westfalica
Thanks @Igor Mashevskyi I left a few comments. Nice work.
Maybe @mlncn wants to have a look afterwards, what he thinks?
- πΊπΈUnited States mlncn Minneapolis, MN, USA
It works great!
With one strange caveatβ the attributes collapsed fieldset is also shown when editing the menu item from the view, which is great, but while it showed my
class
andtarget
that i had set when editing the menu link through the Menu UI, it did not show thecontainer_class
that i had set (which, to be fair, never worked as intended, showing on the link itself ascontainer_class
not the item surrounding it) and saving the menu link from the view resulting in stripping thatcontainer_class
out. Minor, but worth opening an immediate bug report after this feature goes in if it cannot be solved right away.Note that Igor Mashevskyi's patch does this for views-provided menu links; it does not provide attributes for other system-provided menu links, or at least not for the user account / login links.
Thank you for this!