Siteconfig groups in tabs

Silverstripe 4.1

Question:

I add extra settings to the siteconfig unto a new tab, but was wondering if you can group settings.
For example.

I have 3 settings for the header compenent.
4 settings for the content.

Can I make them into a group by using a header text for example?

Currently I created the extra settings via the following code:

use SilverStripe\ORM\DataExtension;
use SilverStripe\Forms\FieldList;
use SilverStripe\Forms\TextField;
use SilverStripe\Forms\CheckboxField;
use SilverStripe\AssetAdmin\Forms\UploadField;
use SilverStripe\Assets\Image;

class SentConfig extends DataExtension {     

    private static $db = [
        'PoweredBy' => 'Varchar',
        'PoweredByLink' => 'Varchar',
        'ShowTopFooter' => 'Boolean',
        'ShowSeachBoxHeader' => 'Boolean',
        'headline' => 'Varchar',
        'fullWidthContent' => 'Boolean'
    ];

    private static $has_one = [
        'TopBGImage' => Image::class,
    ];

    public function updateCMSFields(FieldList $fields) 
    {
        $fields->addFieldToTab("Root.Layout", CheckboxField::create("fullWidthContent", "Content at full width when checked"));
        $fields->addFieldToTab("Root.Layout", CheckboxField::create("ShowTopFooter", "Show the top footer block"));
        $fields->addFieldToTab("Root.Layout", $topbgimage = UploadField::create("TopBGImage", "Background Image for top"));
        $topbgimage->setFolderName("theme-images");

        $fields->addFieldToTab("Root.Layout", TextField::create("headline", "Add headline text"));
        $fields->addFieldToTab("Root.Layout", CheckboxField::create("ShowSeachBoxHeader", "Show the searchbox inside the header"));

        $fields->addFieldToTab("Root.Main", TextField::create("PoweredBy", "Powered by"));
        $fields->addFieldToTab("Root.Main", TextField::create("PoweredByLink", "Powered by link"));
    }
}

Cheers,

Hi,

If I understand correctly, you can add header text, separators, etc. with a LiteralField (SilverStripe\Forms\LiteralField | SilverStripe API)

You can group fields together in a FieldGroup. Have a look at the Structure and Utility sections of this docs page: Common FormField type subclasses – SilverStripe Documentation

Thanks for your reply. I have tried it, but it stags all fields next to each other, in stead of below each other (that could be a css thing).

I now use HeaderField to add a h* tag with title above it, which is a bit better than nothing.

For something like this I usually use ToggleCompositeField