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

    ifox

    06/29/2021, 9:45 AM
    You can disable it, see https://github.com/area17/twill/blob/304e16b1b702b99bbf57422cdf825e0f97089963/src/Http/Controllers/Admin/Controller.php#L21
  • i

    ifox

    06/29/2021, 9:46 AM
    are those revisions of the duplicated block?
  • d

    domihagen

    06/29/2021, 9:46 AM
    Thanks! Will try it
  • d

    domihagen

    06/29/2021, 9:46 AM
    Yes
  • c

    chrisdarling

    06/29/2021, 10:36 AM
    First day using Twill today, so far so good! I have a model 'Quote' that I want to manage a hasMany relationship of a model called 'QuoteOption'. Should I use the Repeater here or Browser?
  • i

    ifox

    06/29/2021, 10:38 AM
    hi @chrisdarling! It depends if you want QuoteOption to be created within the Quote form or not. If you do, definitely repeater.
  • c

    chrisdarling

    06/29/2021, 10:39 AM
    It would be created within the Quote form, 'QuoteOption' isn't going to have it's own admin controller
  • c

    chrisdarling

    06/29/2021, 10:42 AM
    So I have tried to follow the Youtube series on setting this up (Connecting Data) but the component doesn't show up in the admin
  • c

    chrisdarling

    06/29/2021, 10:42 AM
    I've added the twill config for block_editor, but not too sure what I should be putting for the component name?
  • i

    ifox

    06/29/2021, 10:44 AM
    ha you don't need any config anymore. The repeater file itself is self sufficient. You'll need a model and repository for QuoteOption though, and from the Quote repository you'll need to save/retrieve the repeater.
  • i

    ifox

    06/29/2021, 10:46 AM
    under
    resources/views/admin/repeaters
    , you'd have something like this:
  • c

    chrisdarling

    06/29/2021, 10:46 AM
    Ok, great, so removed that. Quote model - added the HasBlocks trait? QuoteOption - has model + repository classes QuoteRepository - have addded the afterSave + getFormFields methods
  • i

    ifox

    06/29/2021, 10:48 AM
    you don't need the HasBlocks trait if you're not using the actual block editor field
  • c

    chrisdarling

    06/29/2021, 10:48 AM
    aha, I had a file in 'blocks' folder
  • c

    chrisdarling

    06/29/2021, 10:49 AM
    ok, trait removed 🙂
  • c

    chrisdarling

    06/29/2021, 10:49 AM
    so my quoteoption.blade.php has
    Copy code
    @formField('input', [
        'name' => 'title',
        'label' => 'Title',
    ]);
  • c

    chrisdarling

    06/29/2021, 10:50 AM
    but I get the error
    Copy code
    Block quoteoption 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

    ifox

    06/29/2021, 10:51 AM
    Copy code
    @twillRepeaterTitle('Quote option')
    @twillRepeaterTrigger('Add quote option')
    
    @formField('input', [
        'name' => 'title',
        'label' => 'Title',
    ])
  • c

    chrisdarling

    06/29/2021, 10:52 AM
    No error now but no UI
  • c

    chrisdarling

    06/29/2021, 10:53 AM
    By the way, thank you @User for your help. It's greatly appreciated.
  • i

    ifox

    06/29/2021, 10:54 AM
    for sure! Updated the snippet above.
  • c

    chrisdarling

    06/29/2021, 10:55 AM
    Still nothing. Do I need something in my quote.blade.php perhaps?
  • i

    ifox

    06/29/2021, 11:09 AM
    I assume you added the repeater form field to the quote form with the
    quoteoption
    type?
  • c

    chrisdarling

    06/29/2021, 11:12 AM
    quotes/form.blade.php
    has
    @formField('repeater', ['type' => 'quoteopotions'])
  • c

    chrisdarling

    06/29/2021, 11:12 AM
    I have the code you shared in
    views/admin/repeaters/quoteoptions.blade.php
  • i

    ifox

    06/29/2021, 11:19 AM
    is that typo in your code too? 🙂
  • i

    ifox

    06/29/2021, 11:19 AM
    quoteopotions
  • c

    chrisdarling

    06/29/2021, 11:21 AM
    I'd like to be able to say no.... 😉 thanks @User looks to be working now.
  • c

    chrisdarling

    06/29/2021, 11:21 AM
    Fingers crossed I'll leave you alone now!
  • i

    ifox

    06/29/2021, 11:31 AM
    no worries, glad you got it working
1...353637...484Latest