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.

Customising the CMS /

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

SS3 customizing CMS - custom ItemEditForm template?


Go to End


1018 Views

Avatar
ismooth

Community Member, 25 Posts

2 October 2012 at 11:31pm

I have extended model admin to manage my Order dataobject. How can I use my own template for creating new record form? Closest I've achieved is adding order_admin/admin/templates/Includes/LeftAndMain_EditForm.ss template, but then all other modules use this template.

I've noticed that GridFieldDetailForm.ItemEditField() has hardcoded ->setTemplate('LeftAndMain_EditForm.ss') on line 330. Is it possible to override this? If I try to change template for form's GridField in my getEditForm() of my custom model admin, I get blank form, i.e. none of the controls and tags in template get executed (although all of the methods and properties should exist cause it's simply extension of LeftAndMain).

Any other suggestions?