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.

Customising the CMS

Admin field seperation


Reply

2 Posts   946 Views

Avatar
MichaelGMorgan

2 September 2009 at 2:41am Community Member, 7 Posts

I have a tab in the admin panel (extended on the Page class) called "Misc". I want to add to it 6 new fields but I need the to be visually divided.

For example...

Field1
Field2
<hr/>
Field3
Field4
<hr/>
Field5
Field6

It can be as simple as a horizontal rule or if possible, something a bit nicer (maybe a box with a heading (but not another tab)).

Thanks

Avatar
zenmonkey

2 September 2009 at 1:05pm (Last edited: 2 September 2009 1:07pm), Community Member, 528 Posts

Check this link
http://doc.silverstripe.org/doku.php?id=form-field-types#structure

and

http://doc.silverstripe.org/doku.php?id=form-field-types#dataless_utility

You should be able to group your fields with

new FieldSet (
new FieldGroup(
new HeaderField("this is my header", 2),
put your fields here
),
new FieldGroup(
put your fields here
)
);