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

    ifox

    06/06/2022, 4:55 PM
    then in the controller of your jams.index route, I would pull the singleton by doing JamsPage::first(), which will give you access to the fields you created there. then I would pull all the jams using the Jam model or repository and send both of those things to the view of the jams index page
  • i

    ifox

    06/06/2022, 4:58 PM
    what I was saying is that, on the jams index page, if you dont want to show all jams by default, but instead want to curate which ones are maybe featured on that page, you would add a jams browser field on the singleton. and if you do that, in the frontend controller, you wouldn't pull all jams but only the ones selected for that page. it really depends on what your needs are, you can combine all those things and pull them from a single route in your frontend for rendering
  • l

    lotje-kinable

    06/06/2022, 4:59 PM
    @ifox alright, I will try this out! Thank you! ps. I do feel like the docs need some more screenshots and examples, as a non-native English speaker, the terms used are not always self-explanatory
  • i

    ifox

    06/06/2022, 5:00 PM
    I hear you and we're working on that 🙂
  • c

    ckmirafss

    06/07/2022, 6:37 AM
    Thanks @ifox , it worked! But why is it having a parameter of fm=jpg? Is it possible to disable it? The image was set already to png only.
    img/2c990864-a294-41a0-b544-9669381e8218/union-1x.png?fm=jpg&q=80&fit=max&crop=99%2C56%2C0%2C
    And how do we use altext for images?
  • k

    kalle

    06/07/2022, 7:19 AM
    Copy code
    'glide' => [
        'default_params' => [
            'fm' => 'png',
             ...
         ],
    ],
  • i

    ifox

    06/07/2022, 8:21 AM
    @ckmirafss or set this default to null to get the original format (and you can use that same fm parameter in your image urls to change it)
  • i

    ifox

    06/07/2022, 8:24 AM
    for alt text, ->imageAltText('role') is the main approach but in your case since you're using multiple images you can look into ->imagesAsArray which would return the url and other metadata like the alttext in one go. There's also ->imagesObjects for more control. All are available in singular and plural form.
  • c

    ckmirafss

    06/07/2022, 8:29 AM
    Alright. Cool. Thanks @kalle and @ifox !
  • c

    ckmirafss

    06/07/2022, 8:37 AM
    How to disable the crop params?
  • i

    ifox

    06/07/2022, 8:38 AM
    disable? As in allow a free ratio crop?
  • i

    ifox

    06/07/2022, 8:38 AM
    if that's what you're looking for, you can set the ratio to 0 or null
  • c

    ckmirafss

    06/07/2022, 8:45 AM
    Ah alright. So it should be edited in Model not in twill.php. Thanks!
  • i

    ifox

    06/07/2022, 9:01 AM
    @ckmirafss if it's for a block, no, you should edit it's crop configuration from twill.php, because you may use this block from different models
  • i

    ifox

    06/07/2022, 9:02 AM
    it does work to put it in the model but once you use that block with another model it would find that config
  • c

    ckmirafss

    06/07/2022, 9:02 AM
    yeaah got it! Thanks a lot!!!
  • c

    ckmirafss

    06/07/2022, 10:40 AM
    Hey @ifox I upload the site to live server the images are all missing.
  • h

    Harings Rob

    06/07/2022, 10:41 AM
    Hey @ckmirafss have you copied your storage folder as well? Make sure to run
    php artisan storage:link
    on the server as well.
  • i

    ifox

    06/07/2022, 10:51 AM
    @ckmirafss did you configure your environment to match with where those images are supposed to be?
  • c

    ckmirafss

    06/07/2022, 11:09 AM
    Hey @Harings Rob yup, I’ve done this.
  • c

    ckmirafss

    06/07/2022, 11:10 AM
    You mean these? MEDIA_LIBRARY_ENDPOINT_TYPE=local FILE_LIBRARY_ENDPOINT_TYPE=local
  • i

    ifox

    06/07/2022, 11:16 AM
    that's only part of it but yeah. you're using glide right? The problem might be with your GD/Imagick drivers
  • i

    ifox

    06/07/2022, 11:16 AM
    when you said images are missing, as in 404? 500?
  • c

    ckmirafss

    06/07/2022, 12:46 PM
    @ifox I got this error. League\ Glide\ Filesystem \ FileNotFoundException
  • i

    ifox

    06/07/2022, 12:49 PM
    ok so do you have your files under storage/app/public/uploads?
  • c

    ckmirafss

    06/07/2022, 1:02 PM
    Yup!
  • h

    Harings Rob

    06/07/2022, 1:32 PM
    Maybe something with file permissions on the folders?
  • k

    kalle

    06/07/2022, 1:51 PM
    You should get the full error from where it tries to load the file. You can also share it with us, it would be good.
  • c

    ckmirafss

    06/07/2022, 2:27 PM
    I've already found the issue and yeah, it was the file permission on folders. Thanks again!
  • m

    Mouse83

    06/07/2022, 9:54 PM
    I`m using twill 2.8.2 and Im trying to add a repeater following the youtube tutorial, I created the migration, added the models and relations, and added configuration into twill.php file
1...338339340...484Latest