Problem/Motivation
There may be utility in having a link to edit the view modes from the view mode usage report.
Proposed resolution
The view mode column could display a link, or there could be an entirely new column with this link. This would just need to be sure to link to the view mode of the bundle presented in the same row.
| Comment | File | Size | Author |
|---|---|---|---|
| #2 | 3381322-2.patch | 1.42 KB | mukhtarm |
Comments
Comment #2
mukhtarm commentedDon't know i followed the correct path, but here is a patch that works. Also in the core view modes, we could see the delete option too in the Operations. thanks
Comment #3
megakeegman commentedThanks very much. I was surprised to see this patch this morning. One of the challenges here is that the url you have constructed will only link to the view modes for node entities. However, this module lists view modes on non-node entities as well. Taxonomy terms are one example, and there are many more. At the moment, I am not sure how to account for this, and this is part of my hesitation of trying to accomplish this task at all. I'm sure it is possible, but I am curious if there are any class methods on the entity that will help with retrieving the correct url, so that we don't have to set up any complicated conditionals.
Comment #4
megakeegman commentedI don't believe there to be any such class method. But I believe we can do something like this, if you want to try it out:
Constructing the route manually won't work since these urls have some variation in their path structure.
Comment #5
mukhtarm commentedThanks for the update @MegaKeegMan
Comment #6
megakeegman commentedAfter further investigation, I have found that the approach I stated above will not work. There is no existing general route for view mode display edit forms, as my example code would indicate. This means that in order for this to work, we would need to account for the variation in paths manually, which is stinky. If anyone has more knowledge of an appropriate way to do this, please share.