ifox
07/06/2022, 5:44 PMifox
07/06/2022, 5:47 PMJeanSilva
07/06/2022, 5:55 PM'blocks' => ['title', 'quote', 'text', 'image', 'grid', 'test', 'publications', 'news']
then, I think I'll better rephrase my question hehe: these are the only types of blocks? One example would be to create a block content inside the form to let the user add as many blocks they need, usually it would be paragraphs and images so they can write something and reorder as they need. Then, if they want to add a new block of "video", they could insert the video's url inside a block, then it would print the video in the position the user ordered the blocks.
The application I'm working on uses laravel only for admins to publish content then it sends the data as json to another application that has the views, templates, etc.ifox
07/06/2022, 5:58 PMvideo
block in your application that will become available in the list of blocks you want to allow in a block_editor
field.
eg, filename: views/admin/blocks/video.blade.php
@twillBlockTitle('Video')
@formField('input', [
'name' => 'video_url',
'label' => 'Video URL',
])
ifox
07/06/2022, 5:59 PMifox
07/06/2022, 6:00 PMphp
@twillBlockTitle('Media')
@twillBlockIcon('image')
@formField('medias', [
'name' => 'image',
'label' => 'Images',
'withVideoUrl' => false,
'max' => 20,
])
@formField('files', [
'name' => 'video',
'label' => 'Video',
'note' => 'Video will overwrite previously selected images',
'max' => 1
])
@formField('input', [
'name' => 'caption',
'label' => 'Caption',
'maxlength' => 250,
'translated' => true,
])
@formField('select', [
'name' => 'effect',
'label' => 'Transition Effect',
'placeholder' => 'Select Transition Effect',
'default' => 'cut',
'options' => [
[
'value' => 'cut',
'label' => 'Cut'
],
[
'value' => 'fade',
'label' => 'Fade In/Out'
]
]
])
@formField('color', [
'name' => 'bg',
'label' => 'Background color',
'note' => 'Default is light grey (#E6E6E6)',
])
@formField('input', [
'name' => 'timing',
'label' => 'Timing',
'maxlength' => 250,
'note' => 'Timing in ms (default is 4000ms)',
])
ifox
07/06/2022, 6:01 PMJeanSilva
07/06/2022, 6:03 PMifox
07/06/2022, 6:07 PMJeanSilva
07/06/2022, 7:43 PMJeanSilva
07/06/2022, 7:44 PMifox
07/06/2022, 7:59 PMdakaalim
07/06/2022, 10:03 PMifox
07/06/2022, 10:12 PM24kappa
07/07/2022, 7:06 AMSami
07/07/2022, 7:46 AM@twillRepeaterTitleField('heading', ['hidePrefix' => 'true'])
is below @twillRepeaterTrigger('Add')
, the first line gets printed to the form, example:
beginning of `repeater.blade.php`:
php
@twillRepeaterTitle('Financing step')
@twillRepeaterTrigger('Add step')
@twillRepeaterTitleField('heading', ['hidePrefix' => true])
Results in:Sami
07/07/2022, 7:47 AM['hidePrefix' => true]
isn't there in the last line (or if the last 2 lines are swapped)Sami
07/07/2022, 8:53 AMnumber
(which is an integer in the database) to string and it seems to work just fine 😓Shiftless
07/07/2022, 9:10 AMifox
07/07/2022, 9:16 AMreloadOnSuccess
in your form to force it to reload after a saveifox
07/07/2022, 9:20 AMShiftless
07/07/2022, 9:31 AMShiftless
07/07/2022, 9:38 AMifox
07/07/2022, 9:39 AMifox
07/07/2022, 9:39 AMdedli
07/07/2022, 12:54 PMifox
07/07/2022, 1:23 PMdedli
07/07/2022, 1:42 PMifox
07/07/2022, 1:54 PMifox
07/07/2022, 1:55 PM