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

    user

    08/25/2021, 12:23 PM
    Hi forks, I am newbie in Laravel Twill.
  • u

    user

    08/25/2021, 12:24 PM
    What i am trying is to make settings page like as demo in below screen. could anyone help me?
    p
    • 1
    • 4
  • x

    xbille

    08/25/2021, 12:37 PM
    Hey! I think I found a bug or I am too stupid to use checkboxes. 😉 Maybe someone can help me: In the admin backend I use create.blade.php and form.blade.php. If I put a checkbox or a select field in both of these it ends in a infinite loop of the change Event in the Vue Component. This happens every time I change a checkbox/select the second time. Workaround was to rename the field in one of these files and and write the content back again in the original field with overriding the function prepareFieldsBeforeSave() in the ModelRepository. Is this a known Issue? Attached are 2 screenshots of the loop and the frozen CMS.
  • p

    pboivin

    08/25/2021, 12:44 PM
    settings-page
  • i

    ifox

    08/25/2021, 1:19 PM
    Hi @xbille am I getting correctly that.you currently have the same field in both create and form? If so I would suggest to only include it in the create file when creating (by checking that
    $item
    is not set)
  • i

    ifox

    08/25/2021, 1:20 PM
    that way when you're on the form it's not duplicated
  • a

    Andrej

    08/25/2021, 3:18 PM
    I got a question regarding the WYSIWYG Editors. Is it correct that just the tiptap type can handle Tables correctly? And only the Quill one can be configured to use font-sizes? So there is no way to have one WYSIWG Editor to handle Tables and (!) font-sizes?
  • i

    ifox

    08/25/2021, 3:20 PM
    Hi @Andrej you're correct about tables. I'm unsure about tiptap font sizes, so that's probably right as well at the moment. Does tiptap outside of twill offer that functionality?
  • a

    Andrej

    08/25/2021, 3:21 PM
    Thanks for that fast reply. As far as I understand tiptap should be able to handle font-sizes: https://www.tiptap.dev/api/marks/text-style/#textstyle But that extension isn't loaded by twill.
  • a

    Andrej

    08/25/2021, 3:23 PM
    it seems to be released in v2, which is in beta phase 😦 So not officially supported yet, I guess
  • i

    ifox

    08/25/2021, 3:24 PM
    ha so yeah the thing with tiptap is that a lot of extensions do not ship a UI. I would welcome a PR, but I'm afraid the UI work is going to be a bit difficult, though we could take inspiration from how it's looking on the Quill implementation
  • a

    Andrej

    08/25/2021, 3:28 PM
    alright, thanks for your input. 🙂
  • x

    xbille

    08/26/2021, 5:14 AM
    Hey @User, yes its the same field. Ok, thats another workaround. Will this never work?
  • g

    giuseppemastrodonato

    08/26/2021, 2:48 PM
    Hello guys! I'm new to Twill and I'm diving the docs before trying it. I was wondering if I can plug Twill in an application with existing models and migrations.
  • p

    pboivin

    08/26/2021, 2:54 PM
    Hi @User , yes this totally possible! Would your goal be to manage existing models/records from the Twill UI?
  • g

    giuseppemastrodonato

    08/26/2021, 2:55 PM
    Yeah! That's actually what I'm looking for
  • p

    pboivin

    08/26/2021, 3:00 PM
    Twill models are really just standard Eloquent models with some sugar on top. I can think of 2 ways to go about it. Generate a Twill module and: 1. create a relationship between the Twill model and the existing model (easier but more "wiring things up") 2. swap out the generated model with your existing model (more difficult, need to be familiar with what a Twill model does through behaviors)
  • g

    giuseppemastrodonato

    08/26/2021, 3:05 PM
    Thanks for your feedback. What do you mean with "Create a relationship between the Twill model and the existing model"? If I have a model "Video" and I generate a twill module "Video", will it overwrite the old model? Or it will create a new, different, one?
  • p

    pboivin

    08/26/2021, 3:08 PM
    By "Create a relationship", I mean create a new Twill model that will be attached to your original model. This won't cover all use cases but an example I can think of: create a Profile model to be attached to an existing User model.
  • p

    pboivin

    08/26/2021, 3:08 PM
    I believe if you run
    php artisan twill:make:module videos
    with an existing Video model, Twill will generate all of the other parts of the module (view, controller, etc.) but will not override your existing model.
  • g

    giuseppemastrodonato

    08/26/2021, 3:12 PM
    thanks @User! I believe I will go to the other solution (swapping models) since the ones I want to manage from Twill are quite simple
  • g

    giuseppemastrodonato

    08/26/2021, 3:12 PM
    Will do some tests and let you know 🤟
  • p

    pboivin

    08/26/2021, 3:13 PM
    Cool, yeah, please do! As far as I can tell, not many people are doing this. I'm super curious 🙂
  • u

    user

    08/27/2021, 12:10 PM
    Hi there, is there a repo that contains the Demo app featured in Twill page? Thank you.
  • p

    pboivin

    08/27/2021, 12:53 PM
    Hi @User , the source for the Pentagram demo is not available unfortunately, but there are 2 starter projects I can think of, in case this can help you: https://github.com/cwsdigital/cws-twill-base https://github.com/croustille-io/twill-boilerplate
  • u

    user

    08/27/2021, 12:53 PM
    @User Thank you
  • s

    sapta34

    08/28/2021, 5:11 AM
    I want to create a template in admin from where I can send a custom email. in the admin form, there will be a static input box where the admin can add multiple emails and a textarea box. After submitting an email sent to all the email ids added in that box. But I can't find any documentation for that. can anyone pls help me with this?
  • p

    pboivin

    08/28/2021, 12:47 PM
    Hi @User , have a look at the Laravel documentation for configuring & sending emails: https://laravel.com/docs/8.x/mail
  • p

    pboivin

    08/28/2021, 12:51 PM
    On the Twill side, I can think of 2 ways to approach this: 1. Create a new module with all your required fields in
    form.blade.php
    . Then, send the email from the
    afterSave()
    hook in the module repository. You could mark the message as "sent" in a boolean or datetime DB column, to avoid sending a message multiple times. This is probably the easier option. 2. Create a custom CMS page to build your form, with a custom controller to receive the data and fire up the email. I think this option is more flexible but harder than 1.
  • s

    Shiftless

    08/30/2021, 12:31 PM
    We would like to translate twill-navigation.php title so that the navigation in the cms is not only in englisch. Is there a way to do translations for stuff like navigation item titel or block title for example?
1...808182...484Latest