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

    ifox

    06/06/2022, 9:05 AM
    that doesn't mean you have to duplicate your frontend controller code, you can share the code between the 2
  • d

    dedli

    06/06/2022, 9:17 AM
    I have three type of layout depending of in what section I am, I should think about how can I share my code. Thanks a lot for help! Is it possible to remove or hide this button temporary?
  • i

    ifox

    06/06/2022, 9:27 AM
    the preview button?
  • i

    ifox

    06/06/2022, 9:34 AM
    I see that we still need to expose that more explicitely. Right now it is linked to using HasRevisions on your model. If you want to continue storing revisions but prevent users from previewing, this workaround might be viable for you:
    Copy code
    @extends('twill::layouts.form', [
        'revisions' => [],
        'reloadOnSuccess' => true
    ])
  • i

    ifox

    06/06/2022, 9:35 AM
    otherwise simply remove the revisions feature from your module
  • d

    dedli

    06/06/2022, 9:53 AM
    Ok, thanks a lot!
  • l

    lotje-kinable

    06/06/2022, 10:54 AM
    Hi again 🙂 I'm not sure how to set this up: - I have a page with Jams (marmelade etc...) and I made a module for a Jam. But on the index page of Jams, I also need to show some information, about the prices and the different options that are available. But these sections cannot be hardcoded as the prices and/or options might change. How can I create an index page with additional content that also features an overview of jams (that link to their own page) I do not understand many parts of the docs...
  • k

    kalle

    06/06/2022, 11:12 AM
    Whats index page for you? Can you share a screenshot with us. @lotje-kinable
  • g

    Gvido Blue Fox

    06/06/2022, 1:24 PM
    Hi! How i can do several 'a17-fieldset' in the settings template?
  • d

    dedli

    06/06/2022, 2:52 PM
    Copy code
    @section('fieldsets')
    <a17-fieldset id="section1" title="Website Screengrabs" :open="true">
     @formField('input', [
    'name' => 'input1',
    'label' => 'label1',
    ])
    </a17-fieldset>
    
    <a17-fieldset id="section2" title="Website Screengrabs" :open="true">
    @formField('input', [
    'name' => 'input2',
    'label' => 'label2',
    ])
    </a17-fieldset>
    @endsection
  • z

    zoi

    06/06/2022, 3:12 PM
    hello, I'am trying to create a capsule with twill packages but i don't know how to configure twill's blocks in a form, my from doesn't show up the blocks. I try to register the blocks directory but its not working.
  • i

    ifox

    06/06/2022, 3:59 PM
    Hi @zoi does it work if you add your package blocks folder to your app twill.block_editor.directories config?
  • z

    zoi

    06/06/2022, 4:19 PM
    no it doesnt work it goes on error
  • l

    lotje-kinable

    06/06/2022, 4:20 PM
    sure! I hard coded the first 2 sections, but I would like them to be adjustable too.
  • k

    kalle

    06/06/2022, 4:42 PM
    Ok I get the idea. Are those products below variants or? You can easily create that with repeaters.
  • l

    lotje-kinable

    06/06/2022, 4:43 PM
    well I already created these (Jam.php, JamController, ...)
  • k

    kalle

    06/06/2022, 4:45 PM
    Yes, that are main product which are you visiting? You are asking how to make dynamic variants of that product below or those products are main ones but just under this category?
  • i

    ifox

    06/06/2022, 4:45 PM
    I think you're really looking for a singleton module @lotje-kinable
  • i

    ifox

    06/06/2022, 4:46 PM
    it works like a normal module but with a single record, so no listing
  • i

    ifox

    06/06/2022, 4:46 PM
    https://demo.twill.io/about
  • l

    lotje-kinable

    06/06/2022, 4:47 PM
    @ifox okay but I just to combine two different 'models' eg. the sections with information + the product listing, and that's possible with a singleton?
  • i

    ifox

    06/06/2022, 4:47 PM
    for sure, in your frontend controller for that page you can pull both the content of the singleton and all your products
  • i

    ifox

    06/06/2022, 4:48 PM
    you could also decide to add a browser field of products on your singleton if you wanted to feature some for example
  • k

    kalle

    06/06/2022, 4:50 PM
    But he has products per category? Any way to connect them under singleton or does he need multiple singletons for that?
  • l

    lotje-kinable

    06/06/2022, 4:51 PM
    @ifox I'm not quite sure I understand it, but I'll try to recap in my own words: I need a controller for the 'products' - page, which will load both the sections (from the singleton) and the products? Or does the singleton contain both sections (or more if the clients needs more) and I add the products to the singleton
  • i

    ifox

    06/06/2022, 4:51 PM
    the singleton doesn't really matter about the dynamic part, if you want to manage content for a product category page you'd do that on the category module
  • i

    ifox

    06/06/2022, 4:53 PM
    @lotje-kinable if I understand correctly you have those routes in your frontend: - jams.index, which shows some content + a listing a jams - jams.show, which shows a single jam
  • i

    ifox

    06/06/2022, 4:53 PM
    correct?
  • l

    lotje-kinable

    06/06/2022, 4:53 PM
    @ifox correct (although the jams.show is not used as all the info about the jams is already on the card)
  • i

    ifox

    06/06/2022, 4:54 PM
    ok sounds good! so I would create a jamsPage singleton where you can create all the fields you need that are outside of the list of jams cards
1...337338339...484Latest