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

    amargoCactus

    11/26/2022, 3:49 PM
    it worked on the project without twill
  • i

    ifox

    11/26/2022, 3:50 PM
    the difference is that twill uploader is doing direct upload from your browser to the object storage
  • i

    ifox

    11/26/2022, 3:51 PM
    it doesn't go through the Laravel app outside of getting a signature for the frontend request
  • i

    ifox

    11/26/2022, 3:51 PM
    that's why cors rules are important to get right
  • i

    ifox

    11/26/2022, 3:52 PM
    I have no experience with contabo unfortunately
  • a

    amargoCactus

    11/26/2022, 3:58 PM
    I think the problem is something else, the bucket url is something like https://usc1.contabostorage.com/my-bucket but the public sharing url is https://usc1.contabostorage.com/281158c2879744c0a32493bac29d8ac6:my-bucket
  • a

    amargoCactus

    11/26/2022, 4:00 PM
    testing with curl I discovered that when I make a request to https://usc1.contabostorage.com/my-bucket it will always respond with 401, but with the other url it gives 403
  • a

    amargoCactus

    11/26/2022, 4:07 PM
    I have tried to make twill be able to set the public url but it always ends up adding
    my-bucket
    as subdomain, if I set the PATH_STYLE_ENDPOINT to true it overrides the path I need I had the idea to directly change the code that generates that URI to see what would happen, however what I get is a 503 error
  • a

    amargoCactus

    11/26/2022, 5:19 PM
    maybe this is why i get Unauthorized? (this is from contabo's doc)
  • m

    MikeR

    11/27/2022, 6:55 AM
    Has anyone here had any success in using a Cloudflare R2 bucket in Twill? I'm currently bumping into a CORS error — OPTIONS request throws a 400 and the subsequent POST throws the CORS error. I have published a CORS policy to the bucket, but this doesn't appear to make a difference at all.
  • m

    MikeR

    11/27/2022, 7:28 AM
    Ok I think this is actually a CF issue. https://community.cloudflare.com/t/problem-with-settings-cors-policies-on-r2/432339/7
  • d

    DKC

    11/28/2022, 11:01 AM
    May I know if there is a solution to handle this case (Twill 3): I have a block "Slide" and I want to have two very similar repeaters "left links" & "right links" so I am going to write this on block definition blade:
    Copy code
    php
        <x-twill::repeater
            type="links-repeater"
            name="left_links"
            label="Left links"
            :max="5"
        />
        <x-twill::repeater
            type="links-repeater"
            name="right_links"
            label="Right links"
            :max="5"
        />
    However the name & label are not working on backend, I guess "type" is keep using in the repeater. And conflicts are happening between two repeaters due to same "type" is using. So in short, can I override the name of "type", by overriding name, to define two repeater separately in the same form.
  • i

    ifox

    11/28/2022, 11:03 AM
    Unfortunately at the moment that wouldn't work indeed. I would suggest creating 2 repeater files that include the same partial view to avoid repeating yourself. Then in the above code you case use the 2 different types. But I agree this would be better if we supported reusing the same repeater type in the same form.
  • b

    BA7YA

    11/28/2022, 11:21 AM
    Hi @ifox Do we have any news about condition fields? I was writing here a week ago, that value of hidden fields are still saving
  • k

    kalle

    11/28/2022, 11:35 AM
    If values of hidden values are still saving, you can overwrite that behaviour by
    Copy code
    php
    // Your repository
    public function afterSaveHandleBlocks(Model $object, array $fields)
    {
      unset($fields['your_hidden_input_fieldname');
      return parent::afterSaveHandleBlocks($object, $fields);
    }
  • b

    BA7YA

    11/28/2022, 11:37 AM
    Thanks for answer, but this behaviour right now in all blocks. I don't think, that I will describe all fields in this method 🙂
  • k

    kalle

    11/28/2022, 11:41 AM
    I would like to understand, where do you use those hidden fields values if you dont want them saved?
  • b

    BA7YA

    11/28/2022, 11:43 AM
    @kalle This fields are under condition, and sometimes they are hidden if condition is false. So if they were filled before condition is false , it's still will be saved even if it's hidden
  • i

    ifox

    11/28/2022, 11:46 AM
    @BA7YA when using
    _connected_fields
    in a block, you need to pass
    'renderForBlocks' => true
  • b

    BA7YA

    11/28/2022, 11:47 AM
    Yeah. But even that renderForBlocks will not fix my issue
  • i

    ifox

    11/28/2022, 11:47 AM
    yea I'm not saying it will fix it but you still need it for it to work properly
  • k

    kalle

    11/28/2022, 11:48 AM
    Ok, I get you. But if those were module fields, you would still need to define them in the Model, so idk, but you can treat them ignored if they dont have values, or unset like in example above if xx fields is false, ignore else leave the fields. But this should be default behavior in blocks, or Im missing something.
  • i

    ifox

    11/28/2022, 11:49 AM
    he's talking about hidden fields from the connected fields util, they are not supposed to be kept and saved in the block data if
    keepAlive
    is not set to true
  • b

    BA7YA

    11/28/2022, 11:49 AM
    Exactly
  • k

    kalle

    11/28/2022, 11:50 AM
    Im not so experienced with blocks, so Ill leave it to the pros 😄
  • b

    BA7YA

    11/28/2022, 11:51 AM
    😁
  • d

    Defenestrația

    11/29/2022, 2:07 AM
    Is it possible to create a module that does not have a "draft/live" toggle?
  • d

    DKC

    11/29/2022, 2:17 AM
    Yes, I think it is better to allow reusing the same repeater type in the same form. Thanks so much.
  • d

    DKC

    11/29/2022, 6:59 AM
    Hello, I have a question about slug & permalink. When using HasSlug, can I set the permalink to be "not translatable", and keep sync the permalink in the same Page among languages?
  • h

    Harings Rob

    11/29/2022, 7:24 AM
    @DKC you can use a getPermalinkBaseUrl to override it in the modulecontroller
1...430431432...484Latest