menu

Twill

Rapidly create a custom admin console that content publishers will love. Twill is an open source CMS toolkit for Laravel, crafted by AREA 17.

Channels
# All channels
view-forward
# General
view-forward
# Announcements
view-forward
# Feature requests
view-forward
# Help
view-forward
# Jobs
view-forward
# Product vision
view-forward
# Resources
view-forward
# Show and tell
view-forward
# Tips and tricks
view-forward
Team

Problem with block creation. What I doing wrong?

November 21, 2020 at 12:33pm

Problem with block creation. What I doing wrong?

November 21, 2020 at 12:33pm
Hello!
I want to make a block with wysiwyg. Created file resources/views/admin/blocks/wysiwyg.blade.php with this content:
@formField('wysiwyg', [
'name' => 'text',
'label' => 'Tartalom',
'toolbarOptions' => [
['header' => [2, 3, 4, 5, 6, false]],
'bold',
'italic',
'underline',
'strike',
["script" => "super"],
["script" => "sub"],
"blockquote",
['list' => 'ordered'],
['list' => 'bullet'],
['indent' => '-1'],
['indent' => '+1'],
["align" => []],
["direction" => "rtl"],
'link',
"clean",
],
'editSource' => true,
])
Added to twill.php config file:
'block_editor' => [
'blocks' => [
'wysiwyg' => [
'title' => 'Editor',
'icon' => 'text',
'component' => 'a17-block-wysiwyg',
],
]
]
And the error what i get: Property 'title' not found on block wysiwyg. , vendor/area17/twill/src/Services/Blocks/Block.php:244
In this method not find the title value, config("twill.block_editor.blocks.{$blockName}.{$property}"), but there exists in my twill.php config file.
What I doing wrong? I missed something? Please help!
Thanks in advance.

November 26, 2020 at 3:22pm
Hi, me also having this error. Don't solved yet, but I suspect it's related to the name of the block: wysiwyg is the same name of the block that came with Twill installation.
  • reply
  • like
I'm trying to override the two standard block's you can find just after installing Twich: image and text (witch is the one related to a17-block-wysiwyg), and I get the same error.
  • reply
  • like

December 2, 2020 at 2:48am
I had the same problem and that brings me here after a google search.
I have solved the issue by adding following attributes in the block blade file. Add these attributes on top of your block blade file under admin directory.
@twillBlockTitle('BlockName')
@twillBlockIcon('text')
@twillBlockGroup('app')
  • reply
  • like