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

    pboivin

    09/01/2021, 4:05 PM
    this will get merged with the built-in styles
  • i

    Ivan Markov

    09/01/2021, 4:07 PM
    i would also like to rearrange the output a bit and add my own wrapper
  • p

    pboivin

    09/01/2021, 4:09 PM
    Ah ok. I don't think you can publish the package's blade views but it would be useful to add!
  • i

    ifox

    09/01/2021, 6:21 PM
    I think any package views can be overriden by putting them under resources/views/vendor/package-name/...
  • i

    ifox

    09/01/2021, 6:21 PM
    i think, not sure
  • p

    pboivin

    09/01/2021, 7:19 PM
    @User just did a quick test and it works! I had to adjust to
    resources/views/vendor/image
    , to fit how the package registers its views.
  • p

    pboivin

    09/01/2021, 7:21 PM
    @User so you could add your wrapper by overriding the
    picture.blade.php
    view (which you may have figured out by now 😄 )
  • k

    Klief

    09/01/2021, 7:38 PM
    I'm having trouble getting my crops to work in my blocks. Is this correct usage in the twill config?
  • p

    pboivin

    09/01/2021, 7:39 PM
    @User Yep, looks good
  • k

    Klief

    09/01/2021, 7:41 PM
    Do I need to define the crops that the block can use somewhere in that case? I have them in the site renderblock, but in my admin block definition I just use a media formfield tag
  • k

    Klief

    09/01/2021, 7:41 PM
    eg.
  • p

    pboivin

    09/01/2021, 7:43 PM
    Ah, I see! So you would need to use
    'name' => 'photoblock'
    in your
    medias
    field to use your crop configuration
  • k

    Klief

    09/01/2021, 7:44 PM
    Oooohhh okay
  • k

    Klief

    09/01/2021, 7:46 PM
    Okay that seems to work now! 🙂 Awesome. But how do I distinguish multiple of these photo's in that case? Do I need to create 4 different crop configurations in the Twill config in that case?
  • p

    pboivin

    09/01/2021, 7:47 PM
    Not sure if there's a better way but what I do to reuse crop configs across blocks is with a simple variable:
    Copy code
    'block_editor' => [
            'crops' => [
                'single_image' => $single_image_crops,
                'image_left' => $single_image_crops,
                'image_right' => $single_image_crops,
            ],
    
            ...
        ],
  • k

    Klief

    09/01/2021, 7:48 PM
    Seems great to me, thanks! Will use the same method
  • i

    ifox

    09/01/2021, 8:07 PM
    nice! another way to reuse across blocks and models is to use constants in a php file
  • i

    ifox

    09/01/2021, 8:08 PM
    eg
    Crops::SQUARE
  • i

    Ivan Markov

    09/01/2021, 8:47 PM
    Thanks. I incorrectly registered the path for redefinition
  • s

    Shiftless

    09/02/2021, 10:08 AM
    after an update to 2.5 we get an error during
    php artisan package:discover
    =>
    PHP Fatal error:  Uncaught Error: Class "App\Exceptions\Handler" not found in /root/development/iu/repos/website-twill-academy-mvp/vendor/area17/twill/src/Exceptions/Handler.php:10
    What are we doing wrong?
  • i

    ifox

    09/02/2021, 10:11 AM
    hey @Shiftless that might be our fault. Do you not have the default Laravel exceptions handler at
    app/Exceptions/Handler.php
    in your Laravel app?
  • s

    Shiftless

    09/02/2021, 10:12 AM
    yes we do have one.
    Copy code
    <?php
    
    namespace App\Exceptions;
    
    use A17\Twill\Exceptions\Handler as ExceptionHandler;
    use Throwable;
    
    class Handler extends ExceptionHandler
    {
  • i

    ifox

    09/02/2021, 10:13 AM
    uh oh, sorry about that. looking into it! cc @antonioribeiro
  • s

    Shiftless

    09/02/2021, 10:15 AM
    in the composer.json there is
    "App\\": "vendor/orchestra/testbench-core/laravel/app"
  • i

    ifox

    09/02/2021, 10:16 AM
    @Shiftless did you set
    twill.bind_exception_handler
    to false?
  • s

    Shiftless

    09/02/2021, 10:16 AM
    let me check
  • i

    ifox

    09/02/2021, 10:16 AM
    in your composer.json? Or Twill's?
  • s

    Shiftless

    09/02/2021, 10:16 AM
    twills composer.json
  • s

    Shiftless

    09/02/2021, 10:17 AM
    it is set to true
  • i

    ifox

    09/02/2021, 10:17 AM
    that's for our tests suite, but this might conflict with extending the handler now that it depends on yours
1...848586...484Latest