silverstripe-admin icon indicating copy to clipboard operation
silverstripe-admin copied to clipboard

Shorter links for ModelAdmin items

Open sminnee opened this issue 4 years ago • 4 comments

Right now an item on a ModelAdmin has the URL of: /admin/(modeladmin)/(tab)/EditForm/field/(tab)/item/214/edit

This would be usefully contracted to without losing ambiguity: /admin/(modeladmin)/(tab)/edit/214

  • $Tab/edit/$ID Can be a new rule.
  • The default action (edit) can be supplied by the rule (since edit precedes the ID)

Changing the URLs in this way could be disruptive and so I would introduce it as an optionally enabled feature of ModelAdmin in 4.x.

To implement this, will require:

  • A new routing rule on ModelAdmin
  • A mechanism for monkeypatching the GridField item request URL generation. Probably a setter method on the GridFieldConfig component that lets the Base URL be overridden.

sminnee avatar Jul 09 '20 01:07 sminnee