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

    ifox

    07/18/2022, 1:16 PM
    https://github.com/area17/twill/blob/2.x/views/partials/form/utils/_fieldset.blade.php
  • m

    MedvedOurs

    07/18/2022, 1:17 PM
    In any case, that's great, thank you for the help!
  • m

    MedvedOurs

    07/18/2022, 1:19 PM
    Another question - maybe you can point me in the right direction. So I'm doing this upgrade from 'legacy' (with the old block configuration in the file). The blocks are rendered properly on the front end side, but the block editor itself doesn't seem to appear in the form. Any idea how I could solve that?
  • i

    ifox

    07/18/2022, 1:29 PM
    try to see if your blocks are correctly listed by
    php artisan twill:list:blocks
  • i

    ifox

    07/18/2022, 1:29 PM
    did you remove the config and used
    @twillBlockTitle
    directives?
  • i

    ifox

    07/18/2022, 1:29 PM
    technically config should still work
  • i

    ifox

    07/18/2022, 1:30 PM
    but you may have used different casing between your file names and configuration which could explain your issue
  • m

    MedvedOurs

    07/18/2022, 1:31 PM
    I didn't remove the configuration and used the new directive - maybe that's my next step
  • m

    MedvedOurs

    07/18/2022, 1:32 PM
    I tried with a simple block editor with only one block in it, it's in the list given by twill:list:blocks as well
  • m

    MedvedOurs

    07/18/2022, 1:32 PM
    I'll triple check the casing
  • m

    MedvedOurs

    07/18/2022, 2:04 PM
    Of I found that one - I didn't re-run twill:update after installing a patch
  • v

    valhalla14

    07/19/2022, 3:50 AM
    Hey, Im not sure if Im missing something but how do you display cropped image on the frontend? Right now, frontend is still displaying the original image even if I have called the correct crop name.
  • h

    Harings Rob

    07/19/2022, 6:16 AM
    Hey @valhalla14 can you show the code you use to render the image and your crop config?
  • v

    valhalla14

    07/19/2022, 8:34 AM
    Copy code
    $image = $model->imageAsArray('image', 'desktop');
    
            return [
    
                'image' => !empty($image) ? $image['src'] : '',
                'image_alt_text' => !empty($image) ? $image['alt'] : ''
            ];
    Copy code
    //config
    'block_editor' => [
            'crops' => [
                'image' => [
                    'desktop' => [
                        [
                            'name' => 'desktop',
                            'ratio' => 0,
                        ],
                    ],
                ],
  • h

    Harings Rob

    07/19/2022, 8:46 AM
    Hmm, that should be fine.
  • h

    Harings Rob

    07/19/2022, 8:46 AM
    I guess the original image has that black bar at the top which is cropped off?
  • v

    valhalla14

    07/19/2022, 9:01 AM
    yes thats correct
  • h

    Harings Rob

    07/19/2022, 9:01 AM
    Ok, I will have a quick check, are you on twill 2.8?
  • v

    valhalla14

    07/19/2022, 9:02 AM
    Im on 2.6, this is my env setting
    Copy code
    MEDIA_LIBRARY_ENDPOINT_TYPE=local
    MEDIA_LIBRARY_LOCAL_PATH=uploads/
    MEDIA_LIBRARY_IMAGE_SERVICE=A17\Twill\Services\MediaLibrary\Glide
    GLIDE_BASE_PATH=storage/uploads
  • h

    Harings Rob

    07/19/2022, 9:09 AM
    So this seems to work fine. But I wonder, you have $model->imageAsArray, but you are working with a block correct?
  • s

    Sami

    07/19/2022, 10:23 AM
    Hello, we made Vue component for, let's say, block (text with image) Article module . Can we somehow make it so that Twill would use this component in block_editor? The goal is to not create the block in both blade and Vue but to have 1 reusable (preferably Vue) component
  • i

    Ivan Markov

    07/19/2022, 11:01 AM
    Hello. Please advise how best to import data into the model via excel in twill. I'm trying to find something like actions.
  • h

    Harings Rob

    07/19/2022, 11:08 AM
    Hey @Ivan Markov there were some discussions about this trying to find it.
  • k

    kalle

    07/19/2022, 11:27 AM
    You can check this package for this usage. I use it very often, it saves a lot time so we dont have to manaully parse excel files and manipulate data. https://docs.laravel-excel.com/3.1/imports/ Twill 'still' doesnt have any data export/ import funcionality itself, but its in the roadmap. I belive we can make something out of it. All current import/export in my case is done trough custom CMS pages since there you are free to do any logic needed.
  • i

    Ivan Markov

    07/19/2022, 12:22 PM
    Thank you. I will try to make a file upload button in a custom page
  • h

    Harings Rob

    07/19/2022, 12:56 PM
    Hey @Ivan Markov I cannot find immediate posts. But it should be doable easily if you use the repository to "seed". There is some information here: https://github.com/area17/twill/discussions/1386 https://github.com/area17/twill/discussions/1004
  • i

    Ivan Markov

    07/19/2022, 2:19 PM
    Created a simple custom import page. I don't understand why the file key changes its name depending on the file id. Is it possible to give him a permanent key?
  • k

    kalle

    07/19/2022, 2:25 PM
    I'm afraid that not all components are compatiable with the custom pages. I experienced same issues, so switching to default HTML upload button with custom CSS resolved that issue.
  • a

    amargoCactus

    07/20/2022, 12:46 AM
    hello, all the patches made in the 2.x versions will be in the 3.x version?
  • i

    ifox

    07/20/2022, 12:46 AM
    Yes
1...363364365...484Latest