21304 Posts in 5736 Topics by 2603 members
|
Page:
1
|
Go to End | |
| Author | Topic: | 2181 Views |
-
ModelAdmin - Adding new tabs in right panel

16 June 2009 at 8:26pm
Trying to figure out ModelAdmin. Documentation is poor, so I hope someone else can share their experience with the ModelAdmin module.
I have set up a standard Aritcle - Category relation (basically the same as in the docs). When creating a new article, I get the article fields in a Main-tab in the right column panel. How do I add tabs to the new item action? E.g. I want a Image tab where I can set up various image uploads. Anyone have any experience with this?
I would also appreciate tips to where I can find docs on how to expand the module.
Thanks!
-
Re: ModelAdmin - Adding new tabs in right panel

17 June 2009 at 8:06pm
It automatically scaffolds the form fields. if you want to display it tabbed rather then the default I think you need to add a getCMSFields() function to your dataobject article and build up the interface the same way you do with CMSFields for pages - http://doc.silverstripe.com/doku.php?id=getcmsfields you would also need to create the tabs as well (since none exist) - http://doc.silverstripe.com/doku.php?id=tabset
-
Re: ModelAdmin - Adding new tabs in right panel

9 February 2010 at 4:10am
Hi Willr
I was just looking for this and as usual everything is über simple with SilverStripe. This code makes a new tab - without creating any new tabset:
function getCMSFields() {
$fields = parent::getCMSFields();
$fields->addFieldToTab('Root.Main', new ImageField("Picture", "Upload avatar."));
return $fields;
} -
Re: ModelAdmin - Adding new tabs in right panel

18 May 2012 at 11:51pm
When i want to put the image field to another tab, i just do
$fields->addFieldToTab('Root.Images', new ImageField("Picture", "Upload avatar."));
and SS will remove the picture field from the Main and put it in the Images tab
| 2181 Views | ||
|
Page:
1
|
Go to Top |




