I’ve just noticed something I haven’t seen before after enabling the Drupal core contextual_links
module. On an individual taxonomy term page there is now an “Edit” button in the secondary menu at the top of the page. Clicking on this toggles the contextual links dropdown within the taxonomy term content area (this dropdown also appears when hovering over the term content). Within the contextual links dropdown there are links to edit and delete the taxonomy term:
I have seen contextual links before but this “Edit” menu item is new. I’m not sure if this was added with Gin, Admin Toolbar or maybe Drupal core but however it happened, it’s there! IMO having this “Edit” in the secondary menu at the top of the page is a bit weird for farmOS - this would make more sense when editing content (like a blog post) on a more traditional Drupal site.
The menu link aside - I’m curious about replicating this behavior for all farmOS entity types (asset, log, plans) and removing the edit/revision/delete task links entirely (screenshot of current land asset for context):
A few reasons for this:
- Right now there is an inconsistency where term pages have a “Delete” task link but the farmOS entity types can only be deleted from the bottom of the “Edit” page. This can be improved by having the “Delete” link easily accessible in the contextual links dropdown.
- As we add more task links to entity pages (all assets have a “Logs” link, location assets have an “Assets” link, etc) the meaning of these tasks links becomes confusing. Some are for modifying the current entity, others are more “informational” for viewing relationships & additional information about the entity. Removing edit/revision/delete links would increase continuity and reserve more space for future & custom “informational” links.
- Additional links can be added to the contextual links dropdown - this would be a nice place to link to the entity in JSON:API or perhaps hook into 3rd party applications eg: “View asset in field kit”.
I imagine there are some improvements we could make to the contextual links button itself, too. Maybe we would want it to always be displayed instead of only on hover or when toggled with the “Edit” button? Make the button bigger? Maybe move to a different part of the page? I think it might overlap with the map if rendered at the top of the content in these entity pages. Need to think about mobile, too!
An alternative to contextual links could be adding edit/revision/delete as second-level task links under “View”. This would keep these links more visible than contextual links but also take up more vertical space. Overall I think if we can improve the usability of contextual links they could be very effective & simplify the UI, but since they are hidden by default, this is a particularly hard thing to “teach” the user.
Other thoughts on this?