Skip to main content

This site requires you to update your browser. Your browsing experience maybe affected by not having the most up to date version.

We've moved the forum!

Please use forum.silverstripe.org for any new questions (announcement).
The forum archive will stick around, but will be read only.

You can also use our Slack channel or StackOverflow to ask for help.
Check out our community overview for more options to contribute.

General Questions /

General questions about getting started with SilverStripe that don't fit in any of the categories above.

Moderators: martimiz, Sean, Ed, biapar, Willr, Ingo, swaiba

Custom DataObject CMS editor interface


Go to End


2 Posts   1332 Views

Avatar
esakrielaart

Community Member, 59 Posts

20 February 2013 at 4:25am

Hi all,

This is an issue I'm dealing with for a while. In a nutshell, I wish to completely change the way the Fields of a DataObject in the CMS (backend) are displayed, for one specific DataObject (which may be controlled by using a ModelAdmin subclass or via a subclass of LeftAndMain). I think I tried all possible ways of overloading templates etc. without that much of success. So, am I missing the obvious? Your help will be highly appreciated.

Kinds regards,
Maurice Krielaart

Avatar
esakrielaart

Community Member, 59 Posts

24 February 2013 at 4:43am

Solved, but in a rather non proper way.

Explanation: the framework currently is not flexiable enough to understand $this->getTemplatesWithSuffix('_EditForm') for GridFields. That is, as a consequence of the GridFieldDetailForm class, around line 327 where

$form->setTemplate('LeftAndMain_EditForm');

This means that only overloading LeftAndMain_EditForm.ss (as described in http://doc.silverstripe.org/framework/en/howto/extend-cms-interface) will do the job, but that is not a solution in my case.

Hence, you might create a CustomGridFieldDetailForm class which extends the GridFieldDetailForm, with onliest change being the line mentioned above.

I hope this helps others who also struggle with this issue.

Kinds regards,
Maurice Krielaart