jeudi 26 janvier 2017

Silverstripe 3.4+ / how combine certain boolean fields into CheckboxFieldSet?

Is there an easy way to combine certain boolean fields of the actual object to a CheckboxFieldSet (Backend/getCMSfields)? There are other fields in the object that should be not in the set. Instead of have a space wasting line for each checkbox (think: toaster, microwave, oven, bbq...) it would be great to have them in a set next to each other.

The database is designed in a way that I can't separate those easily into their own table. Otherwise this would be quick and easy: CheckboxSetField::create('Amenities','Amenities')->setSource(Amenities::get()->sort('Name')->map('ID', 'Name'))




Aucun commentaire:

Enregistrer un commentaire