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

    ifox

    03/05/2023, 4:22 PM
    Hi @savchuk.ivan looks like that key hasn't been translated before: https://github.com/area17/twill/blob/669dc996bf4f4c591d2b6f1245f19eb90d5acb4d/frontend/js/components/Slideshow.vue#L87
  • m

    MD

    03/06/2023, 12:41 AM
    What's the approach for building a custom form field? I want to replace separated url/target/title fields with a better UI that saves a single
    {"url":"https://google.com/","target":"_blank","title":"Google"}
    JSON object
  • m

    MD

    03/06/2023, 1:04 AM
    ah found it https://gist.github.com/pboivin/19d49cbb3c0a6c5c06469117597cc0f7
  • e

    elkex

    03/06/2023, 8:34 AM
    How can the default language be removed from the permalink URL?
  • t

    Tobi Wan

    03/06/2023, 10:36 AM
    Hi, I want to add a filter to a List Module. I have a form field with a select (https://twill.io/docs/form-fields/select-unpacked.html) and I would like to filter on that value. Eg. List all entries that have value arts + finance. Are there any docs or examples for that?
  • a

    Anders

    03/06/2023, 3:18 PM
    Hi, I'm new to Twill. I'm using 3.0.0-rc4. I'm trying to get image alt tags to work with the Block Editor. I uploaded an image using the Media manager and set an alt tag. If I upload an image in the Block Editor using a formfield 'medias', I can select an image from the mediamanager. When editing that image, I can see the default alt-text greyed out, but I cannot get thatdefault to show using
    Copy code
    $block->imageAltText('image')
    - it just shows up empty. If I fill in an alternative alt text in the block editor, that alternative text shows just fine. How can I get it to fall back to the default alt text?
  • e

    elkex

    03/07/2023, 8:00 AM
    My column filters don't show.. The values of the fields show, but the field titles don't.. I have in my admin controller:
    Copy code
    protected $titleColumnKey = 'title';
    
        protected $indexColumns = [
            'title' => [
                'title' => 'Title',
                'field' => 'title',
            ],
            'firstname' => [
                'title' => 'Firstname',
                'sort' => true,
                'field' => 'firstname',
                
            ],
            'lastname' => [
                'title' => 'Lastname',
                'sort' => true,
                'field' => 'lastname',
            ],
        ];
    i
    • 2
    • 20
  • h

    Hip-Hop

    03/07/2023, 9:39 AM
    @Harings Rob @ifox Good afternoon Tell me what method is responsible for the formation and output of blocks in the record? If at the front it is a render block, then what method should be studied here? The problem is in the long loading of both the admin panel and the front part (if many blocks are used). Now I processed the renderblocks method and the front part began to load from 20s to 2s locally.(redis) I want to see how everything works in the admin panel.
    i
    • 2
    • 1
  • k

    Koili

    03/07/2023, 12:49 PM
    Hey! having some issues with file uploads for a block inside a module. Module has the HasFiles trait, Repository has the HandleFiles trait, and ive added the $filesParams property to the model. The content is translate-able, so the form in the block_editor offers me to choose localisations. Im having trouble with actually persisting the localized form data that is sent. i can see that the files are sent as separate localisations, but they arent being saved. Im assuming my
    filesParams
    are defined incorrectly? Or is it my form fields that are the problem? Form field name is
    citadele_pdf
    Copy code
    php
    @formField('files', [
    'name' => 'citadele_pdf',
    'label' => 'PDF file',
    'note' => 'Add one file per language',
    'max' => 1
    ])
    Side-question: Is it possible to disable localisation for file uploads inside of a block editor block?
  • i

    ifox

    03/07/2023, 12:52 PM
    Hi @Koili since the field is in a block, it is not the model that needs to be configured with the name of your field, but
    twill.block_editor.files
  • k

    Koili

    03/07/2023, 12:53 PM
    ah yes, that makes sense
  • k

    Koili

    03/07/2023, 12:53 PM
    it works now. What about disabling localisation for file uploads?
  • i

    ifox

    03/07/2023, 12:53 PM
    you also don't need HasFiles on the model if you're not using file fields outside of blocks on that model form
  • k

    Koili

    03/07/2023, 12:54 PM
    disabling the localisation is not a big issue, just wondering if its possible
  • i

    ifox

    03/07/2023, 12:55 PM
    that is unfortunately not possible at the moment, but the helpers to retrieve the file attached to the block will always fallback to the main language if no file is provided in other languages
  • i

    ifox

    03/07/2023, 12:55 PM
    so admins don't have to upload the same file in all locales
  • k

    Koili

    03/07/2023, 12:56 PM
    alright, thanks for the info!
  • c

    ckmirafss

    03/08/2023, 9:50 AM
    Hi, how do we usually change passwords on the CMS under User settings?
  • i

    ifox

    03/08/2023, 10:02 AM
    In twill 3 there is a dedicated feature in the CMS to reset another user password and request that they change it during the next login. In twill 2 users need to use the forgot password link on the login page.
  • c

    ckmirafss

    03/08/2023, 10:29 AM
    Okay. Thanks @ifox !
  • e

    elkex

    03/08/2023, 12:59 PM
    Somehow it does not work to save my content in Twill if it is translatable.. I put the fields in my model in the fillable and translatedAttributes objects and also added translated => true to the fields..
  • i

    ifox

    03/08/2023, 1:03 PM
    We're going to need more info @elkex is the column in the translations table?
  • e

    elkex

    03/08/2023, 1:16 PM
    Yes, that all should be ok
  • e

    elkex

    03/08/2023, 1:16 PM
    It does save, but not if I add a boolean field.. Which could differ per language
  • i

    ifox

    03/08/2023, 1:17 PM
    checkbox fields are not translatable at the moment
  • e

    elkex

    03/08/2023, 1:22 PM
    And select fields?
  • i

    ifox

    03/08/2023, 1:24 PM
    nope, input, wysiwyg, medias and files are translatable. I understand your use case though and think we should definitely support checkboxes and select fields
  • i

    ifox

    03/08/2023, 1:26 PM
    Depending on the amount of languages you have, you can use multiple fields with names suffixed by the locale. Not perfect but can unblock you. I'd suggest creating a feature request on GitHub for checkbox translated support.
  • e

    elkex

    03/08/2023, 1:27 PM
    Luckily it's not that impactful if I don't make it translatable 🙂 Thanks!
  • k

    kalle

    03/08/2023, 1:41 PM
    If UI supports translated feature for checkboxes, backend can be tricked to store/read values as other supported translated type.
1...471472473...484Latest