Closed Tom-revere closed 3 months ago
I am trying to create Fieldsets within a block using Form Builder, however they never render in the CMS.
Create a new block Replace the getForm function with the below
getForm
public function getForm(): Form { $form = Form::make(); $form->add(Input::make()->name('title')); $form->withFieldSets(new Fieldsets([ Fieldset::make()->title('Fieldset 1')->id('fieldset1')->fields([ Input::make() ->name('fs1_content') ->label(twillTrans('FS 1 Content')) ]), Fieldset::make()->title('Fieldset 2')->id('fieldset2')->fields([ Wysiwyg::make() ->name('fs2_content') ->label(twillTrans('FS 2 Content')) ]) ])); $form->add(Input::make()->name('description')); return $form; }
It should show Fieldsets between Title and Description.
It does not show any fieldsets, or the fields within these. Only Title and Description show.
Twill 3.2.0 Laravel 9.5.2 PHP 8.0.11 MySQL 5.7.33
Fieldsets are not currently supported in blocks and they haven't been designed to be supported there.
Moving this to a discussion, I'm curious to hear more about the use case for fieldsets in blocks.
Description
I am trying to create Fieldsets within a block using Form Builder, however they never render in the CMS.
Steps to reproduce
Create a new block Replace the
getForm
function with the belowExpected result
It should show Fieldsets between Title and Description.
Actual result
It does not show any fieldsets, or the fields within these. Only Title and Description show.
Versions
Twill 3.2.0 Laravel 9.5.2 PHP 8.0.11 MySQL 5.7.33