https://twill.io logo
Join Discord
Powered by
# ❓questions
  • u

    user

    07/06/2021, 10:32 AM
    Cause it now looks like it isn't set
  • u

    user

    07/06/2021, 10:32 AM
    Even tho it is in the db
  • u

    user

    07/06/2021, 10:33 AM
    I almost moved over my full posts and categories table and that is the most important part 🙂 Than Ill continue with the authors and I have twill mostly working 🙂
  • i

    ifox

    07/06/2021, 10:39 AM
    where and how is it stored in db? in the
    mediables
    table? Twill is not going to render anything in a
    medias
    field if it is not stored the way Twill does.
  • u

    user

    07/06/2021, 10:41 AM
    Medias table
  • u

    user

    07/06/2021, 10:41 AM
    Mediables is empty tho
  • i

    ifox

    07/06/2021, 10:45 AM
    that's the files themselves, not the relationship to your posts, mediables is polymorphic and stores all relationships between your modules and the actual uploaded files in the media library
  • u

    user

    07/06/2021, 10:46 AM
    Ok, so it has been never connected to the post?
  • u

    user

    07/06/2021, 10:46 AM
    Dangit
  • u

    user

    07/06/2021, 10:46 AM
    Didn't think of this, what stupid!
  • u

    user

    07/06/2021, 10:47 AM
    Copy code
    php
    public $mediasParams = [
            'cover' => [
                'thumbnail' => [
                    [
                        'name' => 'free',
                        'ratio' => 0,
                    ],
                ],
            ],
        ];
  • i

    ifox

    07/06/2021, 10:47 AM
    I'd suggest you attach an image and save from the CMS UI to understand what it does in db if you want to migrate
  • i

    ifox

    07/06/2021, 10:47 AM
    replace cover by thumbnail and thumbnail by default in your snippet
  • u

    user

    07/06/2021, 10:48 AM
    Alright
  • u

    user

    07/06/2021, 10:48 AM
    So the first key is the key that it will save to and the second one is what?
  • u

    user

    07/06/2021, 10:48 AM
    Type of size?
  • i

    ifox

    07/06/2021, 10:48 AM
    name of the crop
  • u

    user

    07/06/2021, 10:48 AM
    Alright. I might want to create a small docs for Twill if I get more used to it. Like a straight and simple one.
  • u

    user

    07/06/2021, 10:49 AM
    So I can explain this. I think a bigger community would do very good and that might help
  • u

    user

    07/06/2021, 10:55 AM
    Thanks! Works like a charm 🙂
  • u

    user

    07/06/2021, 12:54 PM
    I've got an issue with adding Blocks to the project, I keep getting the following error:
    Copy code
    Block paragraph does not exists or the mandatory property 'title' was not found on this block. If you are still using blocks on the twill.php file, please check if the block is present and properly configured.
    I've been following the tutorial videos step by step, after creating the
    views/admin/blocks/
    folder with content inside it I'm unable to use
    php artisan
    commands anymore.
  • u

    user

    07/06/2021, 12:54 PM
    As soon as I delete the folder contents, the error stops popping up.
  • p

    pboivin

    07/06/2021, 1:00 PM
    Do you get this error message when running
    php artisan
    ?
  • u

    user

    07/06/2021, 1:00 PM
    Yeah
  • p

    pboivin

    07/06/2021, 1:05 PM
    Are you defining your block in
    twill.php
    config?
  • i

    ifox

    07/06/2021, 1:06 PM
    @User can you share your block view? also I'm assuming you're using configuration based blocks definition like in the video, and like @User is asking? you might want to check the updated block editor documentation here: https://twill.io/docs/#creating-a-block-editor, which doesn't need configuration in the
    twill.php
    file anymore.
  • u

    user

    07/06/2021, 1:07 PM
    Yes, it's defined inside
    twill.php
    as
    Copy code
    'block_editor' => [
            'crops' => [
                'project_image' => [
                    'default' => [
                        [
                            'name' => 'default',
                            'ratio' => 16 / 9
                        ]
                    ]
                ],
                'past_project_image' => [
                    'default' => [
                        [
                            'name' => 'default',
                            'ratio' => 16 / 9
                        ]
                    ]
                ],
                'variable_image' => [
                    'default' => [
                        'name' => 'default'
                    ]
                ]
            ],
            'blocks' => [
                'quote' => [
                    'title' => 'Quote',
                    'icon' => 'quote',
                    'component' => 'a17-block-quote',
                    'rules' => [
                        'quote_text' => 'required'
                    ]
                ],
                'paragraph' => [
                    'title' => 'Paragraph',
                    'icon' => 'text',
                    'component' => 'a17-block-paragraph'
                ],
                'paragraph_image' => [
                    'title' => 'Paragraph & Image',
                    'icon' => 'image-text',
                    'component' => 'a17-block-paragraph_image'
                ],
                'project_detail' => [
                    'title' => 'Past Project Spotlight',
                    'icon' => 'content-editor',
                    'component' => 'a17-block-project_detail',
                    'rules' => [
                        'project_title' => 'required',
                        'project_url' => 'required|url',
                        'project_description' => 'required'
                    ]
                ]
            ]
        ]
  • u

    user

    07/06/2021, 1:08 PM
    What is the last version of twill which still uses blocks being defined as in the video?
    Edit: Got my answer.
  • u

    user

    07/06/2021, 1:11 PM
    Also, what do you mean by the
    block
    view? I've only got separate views which reference names from
    twill.php
    inside
    views/admin/blocks
    and the part which renders those blocks inside
    views/site/blocks
  • p

    pboivin

    07/06/2021, 1:14 PM
    Yep, sounds good! So on Twill >= 2.2, you can omit the configuration in
    twill.php
    , and use the
    @twillBlockX()
    directives to configure directly in the Blade views
1...454647...484Latest