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.

General Questions

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

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

Custom DataObject CMS editor interface


Reply

2 Posts   404 Views

Avatar
esakrielaart

20 February 2013 at 4:25am Community Member, 56 Posts

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

24 February 2013 at 4:43am Community Member, 56 Posts

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