Settings/History tabs for pages added through ModelAdmin

SilverStripe 4.10

I am adding a selection of pages using ModelAdmin rather than in the site tree. The pages are hidden from the hierarchy and I’m using a GridFieldAddNewMultiClass to select the class I want to add (e.g. news, event, recipe).

This is working really well except I don’t have access to the Settings and history tabs when I add or edit the pages. I have found one or two examples of modules that do something similar, but they take the CMS user out of the ModelAdmin and back into the site tree.

I’ve had a look at the Lumberjack module, but as far as I could see in the code, this is designed to be used on a holder page within the site tree rather than in a ModelAdmin.

Would anyone be able to give me an idea of where to head to access the page settings? Or do I need to reconstruct the whole tab manually? I’d rather not because I have other page extensions in play that add to the Settings tab for other things and it all feels messy. Also it’s a module, designed to be shared across a number of sites. Any suggestions or links to code that does something similar would be fabulous :slightly_smiling_face:

have you every found a solution for this?

The settings tab is created a little differently for SiteTree for some reason - they’re handled by an entirely different controller (CMSPageSettingsController), which calls the getSettingsFields() method on the page to get the page’s settings tab.

You’d probably need to make an extension for GridFieldDetailForm_ItemRequest which implements a updateItemEditForm() method - and in that method, check if the record is an instance of SiteTree - if it is, call getSettingsFields() on the record and add the result to the form.