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.

Form Questions /

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

Additional tabbed fields on a Class extending DataObject


Go to End


1645 Views

Avatar
RD

Community Member, 8 Posts

10 October 2014 at 12:55pm

Edited: 10/10/2014 1:04pm

Hi there,
I am trying to add nested tabs in the CMS on a Class that is extending DataObject.

$SubjectTabSets = new TabSet(
            $name = 'SubjectAndCoursesPageTabSets',
            new Tab(
                $title = 'Qualification',
                $QualificationTabHeading
            ),
            new Tab(
                $title = "Study Journey",
                $StudyJourneyTabHeading
            )
        );

$TabbedContentTabSet = new Tab('TabbedContent', $SubjectTabSets);

        $rearrangeFields = new FieldList(new Tabset('Root',
                                $fields->findOrMakeTab('Root.Main'),
                                $TabbedContentTabSet));
        $fields = $rearrangeFields;

return $fields;

The above code keeps throwing the following error PHP Fatal error:  collateDataFields() I noticed that a field called 'SubjectQualificationTabHeading' appears twice in your form: 'Form_ItemEditForm'.  One is a 'TextField' and the other is a 'TextareaField'

Any ideas how to fix this. Basically the what I would like to achieve is the following
1. In the CMS, have a tab called "Individual tabs" on a class that extends DataObject
2. In the "Individual Tabs" have multiple tabs (may be 5 sub tabs) 
3. Each sub tab has form fields

Any help would be very helpful
Thanks
R