ModelAdmin page edit links

Silverstripe Version:

4.12

Question:

I’m using a ModelAdmin to manage an ArticlePage extending the SiteTree Page class, but when I click edit links in the GridField, the form I see is different from the one available from the built-in page management. For example, the add to campaign options are missing.

Edit link from ModelAdmin: http://localhost/admin/articles/ArticlePage/EditForm/field/ArticlePage/item/3170/edit

Edit link from SiteTree: http://localhost/admin/pages/edit/show/3170

Is there some way to specify the latter link in ModelAdmin?

In split view the form actually redirects to the correct place, but in edit mode (no preview pane) it does not.

Please, refrain yourself from considering wrong the above link.

You are comparing apples and oranges: ModelAdmin is a generic approach to model editing (a la django) while the silverstripe-cms module is specifically designed for page editing (and only for that).

1 Like

That link is ultimately determined by the GridFieldEditButton (with a view link being provided by the corresponding GridFieldVewButton).

If you are absolutely sure that you want to change the context in which these records are viewed and edited, you can replace those with your own implementations for this specific ModelAdmin's grid field.
But do be aware that ntd is right - the model admin context is entirely different to the normal page editing context, and you may find that changing the context you get some unexpected behaviour (e.g. the breadcrumbs at the top of the edit form won’t link back to your model admin).