# Use contextual links for entity edit, revision and delete links

**URL:** <https://farmos.discourse.group/t/use-contextual-links-for-entity-edit-revision-and-delete-links/1227>\
**Category:** Using farmOS\
**Tags:** ui-ux\
**Created:** [April 23, 2022, 4:08pm UTC](https://farmos.discourse.group/t/use-contextual-links-for-entity-edit-revision-and-delete-links/1227 "2022-04-23T16:08:55Z")\
**Posts on this page:** 1\
**Showing post:** 3

<div class="post-metadata">

**Author:** ![paul121](https://avatars.discourse-cdn.com/v4/letter/p/54ee81/32.png) [@paul121](https://farmos.discourse.group/u/paul121)\
**Post date:** [September 20, 2022, 9:58pm UTC](https://farmos.discourse.group/t/use-contextual-links-for-entity-edit-revision-and-delete-links/1227/3 "2022-09-20T21:58:20Z")

</div>

> [@mstenta](#):
>
> I definitely see why you’re thinking of moving the View/Edit/Revisions tabs instead…

 ![Screenshot from 2022-09-20 14-35-31](https://global.discourse-cdn.com/free1/uploads/farm_os/original/1X/dea37a11179ee4fed9570337f1385b1030767400.png)

This is actually pretty easy to change! And it isn’t Drupal core, this default is provided by the `entity` module 😉

- The `entity` module allows entities to define a (or multiple?) `local_task_provider`: [farmOS/modules/core/asset/src/Entity/Asset.php at 2b430c04b8e66c83913e70932903aecd7ec3b0d5 · farmOS/farmOS · GitHub](https://github.com/farmOS/farmOS/blob/2b430c04b8e66c83913e70932903aecd7ec3b0d5/modules/core/asset/src/Entity/Asset.php#L45-L47)
- Right now we are using the `DefaultEntityLocalTaskProvider` class provided by `entity`: [Client Challenge](https://git.drupalcode.org/project/entity/-/blob/8.x-1.x/src/Menu/DefaultEntityLocalTaskProvider.php)
- I copied and modified that class slightly to set the `parent_id` instead of `base_route` for the “Edit” and “Revisions” tabs to put them in sub-tabs.

I also changed the top-level “View” tab to read the asset bundle eg: “Plant”. This is just hard-coded for an example, it might be a bit complicated to dynamically add the bundle here. But “View” just doesn’t seem entirely appropriate if “Edit” is one of it’s sub-tabs? We could leave this as “Asset” but then it becomes confusing to have “Logs” and “Assets” as the neighboring tabs… So tldr there might be a better option for the name of this top-level tab, I just thought the bundle “Plant” seems like a decent choice

---

_[View the full topic](https://farmos.discourse.group/t/use-contextual-links-for-entity-edit-revision-and-delete-links/1227)._
