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

    chrisdarling

    06/29/2021, 1:26 PM
    Duplicate on both, print as pdf just on the form
  • p

    pboivin

    06/29/2021, 1:30 PM
    For the index, it's a simple option on the controller : https://twill.io/docs/#controllers
  • c

    chrisdarling

    06/29/2021, 1:31 PM
    Awesome, great that duplicate is built in there.
  • p

    pboivin

    06/29/2021, 1:33 PM
    Yep. Oh, I believe revisions need to be enabled on your module for duplicate to work
  • c

    chrisdarling

    06/29/2021, 1:34 PM
    Good to know, thanks! Here's to hoping custom actions on the form are as simple 😜
  • i

    ifox

    06/29/2021, 1:56 PM
    @chrisdarling on the form, you're kind of free to come up with whatever you want. Some Twill users have been able to reuse the Button component from Twill. What happens when you click on it could be anything, like just a get endpoint in your Laravel routes that would redirect back, or an ajax powered behavior.
  • p

    pboivin

    06/29/2021, 1:56 PM
    Out of curiosity, how is your "Print to PDF" implemented? Is it a PDF download generated from the backend or a custom page triggering the browser's print function?
  • c

    chrisdarling

    06/29/2021, 1:57 PM
    @User interesting! Any guides at all that are worth me taking a look at? @pboivin exactly that, I'm using laravel-snappy to generate a PDF on the fly of the 'quote'
  • p

    pboivin

    06/29/2021, 1:58 PM
    @User Cool! As far as I can tell, you can implement this with a simple tag and a
    download
    attribute. This would link to your custom action, defined on your admin controller or
    routes/admin.php
    , if you are so inclined 🙂
  • c

    chrisdarling

    06/29/2021, 1:58 PM
    Great! And where would I put this tag? what template file or is it in the Vue code?
  • p

    pboivin

    06/29/2021, 1:58 PM
    In your
    form.blade.php
  • i

    ifox

    06/29/2021, 1:59 PM
    https://spectrum.chat/twill/help/need-help-with-executing-custom-js-on-button-click~c6b7d312-4abe-42a4-9ce2-7ecef66fafe3
  • c

    chrisdarling

    06/29/2021, 2:02 PM
    Thanks guys!
  • c

    chrisdarling

    06/29/2021, 2:02 PM
    I've always used a CMS called SilverStripe in the past, but Twill seems good so far.
  • p

    pboivin

    06/29/2021, 2:07 PM
    Did not know about SilverStripe, I'll have a look! I'd be interested to know how the 2 compare from your perspective.
  • c

    chrisdarling

    06/29/2021, 2:09 PM
    SilverStripe is probably easier to get setup and has very similar features OOTB. A few things I'm sad to not see on Twill (they have a 'Site Tree' to structure the heirarchy of your pages/routes which is great for sites I manage that have 100's (1000's?) of pages). But one of my frustrations is that they ended up using React in their latest version and Laravel of course has such a good ecosystem where as they use their own framework.
  • p

    pboivin

    06/29/2021, 2:15 PM
    I see! Yeah, "their own framework" is always a turnoff from my perspective. Coming from a WordPress background, Laravel is just a breath of fresh air 🙂 Definitely more work to get up and running but it really grows with you.
  • p

    pboivin

    06/29/2021, 2:18 PM
    BTW, there is a way to get nested modules setup with Twill. It's not well documented but I believe we can find some examples if you wish to explore this.
  • c

    chrisdarling

    06/29/2021, 2:18 PM
    To be fair to them, their own framework has been around for years... maybe before Laravel or close to. But I don't get why in their major release they haven't made the switch... I suppose they didn;t want upgrade paths to be an absolute pain. They have some fairly large clients running on it
  • c

    chrisdarling

    06/29/2021, 2:19 PM
    Nested modules is definitely something I would use (FWIW silverstripe call this a Gridfield) and you can nest them indefeinitely as far as I am aware
  • c

    chrisdarling

    06/29/2021, 2:21 PM
    If you do have some examples, they would be great to see. I'll likely use Twill on my next portfolio sized project and this current one (I'll likely be the only one with access to Twill anyway) and have our own frontend UI. Be interesting to see how it pans out, but nice to see that there's a responsive team behind the product who are open to feedback.
  • p

    pboivin

    06/29/2021, 2:29 PM
    I'll get back to you re. nested modules. Not sure if there is already a working example in the Spectrum/Github archives.
  • i

    ifox

    06/29/2021, 3:40 PM
    https://twill.io/docs/#nested-module
  • i

    ifox

    06/29/2021, 3:44 PM
    this allows a single module to be nested, with the listing allowing nested drag and drop
  • i

    ifox

    06/29/2021, 3:45 PM
    not to confuse with another type of nesting, which allows multiple modules to be nested: https://github.com/area17/twill/issues/508
  • c

    chrisdarling

    06/29/2021, 3:48 PM
    I think it's likely the latter in my case if I understand correctly. I have: - Quote - QuoteOption (has_many to Quote) - Product (many_many to QuoteOption) I want to be able to manage
    Product
    via the
    QuoteOption
    Repeater
  • i

    ifox

    06/29/2021, 4:08 PM
    oh that would be another repeater or browser within
  • i

    ifox

    06/29/2021, 4:10 PM
    you can use a browser field for products inside of the QuoteOption repeater
  • c

    chrisdarling

    06/29/2021, 4:16 PM
    Awesome - I've got this appearing but not saving right now... but I'll try figure this out myself 🙂
  • k

    Kirk Bushell

    06/30/2021, 12:10 AM
    I am really stuck here, now 3 days - I have a variable in my view template that Twill thinks exists, but it doesn't exist in my template. Views are not cached...
1...373839...484Latest