-
Notifications
You must be signed in to change notification settings - Fork 95
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Shorter links for ModelAdmin items #1075
Comments
@chillu make sense to you? |
Yeah that makes a lot of sense. Context for others, this builds on a pending PR in #1072. I wonder if it's better to hide the complexity away from GridField and handle this within ModelAdmin only. Maybe we can make My only concern is that we're breaking URL symmetry with |
Sounds fine. If someone adds extra actions to the GridField without also modifying ModelAdmin you would end up with something like
Something like this makes sense to me $gf->getConfig()->getComponentByType(GridFieldDetailForms::class)
->setItemLinkCallback(function ($gridFieldItemHandler, $record, $action) use ($modelAdmin) {
return Controller::join_links($modelAdmin->Link(), $modelAdmin->tabName, 'edit', $record->ID);
}) So we just need to define With this in place, one might make even more streamlined URLs on a project-specific basis. For example, I might make |
I don't think this would be valuable anymore - the changes made as part of #1354 trivialise getting a canonical edit URL for any given record, and since this isn't the front-end the value of having short URLs people can remember is basically nil. |
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.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:
The text was updated successfully, but these errors were encountered: