ifox
01/29/2023, 2:34 AMifox
01/29/2023, 2:35 AMifox
01/29/2023, 2:37 AMamargoCactus
01/29/2023, 3:10 AMamargoCactus
01/29/2023, 3:10 AMifox
01/29/2023, 10:47 AMamargoCactus
01/29/2023, 7:05 PMamargoCactus
01/29/2023, 7:05 PMErwin
01/30/2023, 11:30 AM@twillBlockTitle('News showcase')
@twillBlockIcon('text')
@twillBlockGroup('app')
@formField('input', [
'name' => 'title',
'label' => 'Title',
])
@formField('repeater', ['type' => 'news-showcase-item'])
This is my repeater item code:
@twillRepeaterTitle('news-showcase-item')
@twillRepeaterTitleField('news-showcase-item', ['hidePrefix' => true])
@twillRepeaterTrigger('Add card')
@twillRepeaterGroup('app')
@formField('medias', [
'name' => 'image',
'label' => 'Image',
'note' => 'Persoon foto',
])
@formField('input', [
'name' => 'name',
'label' => 'Naam',
])
@formField('input', [
'name' => 'description',
'label' => 'Beschrijving',
'maxlength' => 250,
'type' => 'textarea',
'rows' => 3,
])
@formField('input', [
'name' => 'link',
'label' => 'Link',
'maxlength' => 60,
])
When i save my page it stores the item in the blocks table 2 times, one time with the right child_key (news-showcase-item) and one with with a strage child_key (blocks-185_news-showcase-item).
When i edit something in the repeater item and save my page again it removes te repeater item in the blocks table with the right child_key and leaves the strange child_key. Resulting in the repeater item being removed in the twill admin view...
Is this a known problem or am i doing something wrong?ifox
01/30/2023, 11:32 AM@twillRepeaterTitleField('news-showcase-item', ['hidePrefix' => true])
which should probably be @twillRepeaterTitleField('name', ['hidePrefix' => true])
instead, as there are no news-showcase-item
field in the repeater.Erwin
01/30/2023, 11:41 AMErwin
01/30/2023, 11:43 AMErwin
01/30/2023, 11:44 AMifox
01/30/2023, 11:51 AMErwin
01/30/2023, 11:51 AMifox
01/30/2023, 11:52 AMErwin
01/30/2023, 11:56 AMifox
01/30/2023, 11:56 AMErwin
01/30/2023, 12:02 PMifox
01/30/2023, 12:06 PMHarings Rob
01/30/2023, 12:07 PMHarings Rob
01/30/2023, 12:07 PMjefsev
01/30/2023, 6:59 PMHarings Rob
01/30/2023, 7:08 PMHarings Rob
01/30/2023, 7:09 PM$renderData->model
should give you the model in which the block is being renderd.jefsev
01/30/2023, 8:00 PMelkex
01/31/2023, 6:08 PMifox
01/31/2023, 6:13 PMelkex
01/31/2023, 6:13 PMifox
01/31/2023, 6:13 PM