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

    Dmi3yy

    05/20/2021, 7:56 AM
    For use Medias in Settings need add in config/twill.php
    Copy code
    'settings' => [
            'crops' => [
                'setting_image' => [
                    'default' => [
                        [
                            'name' => 'foobar',
                            'ratio' => 1,
                        ],
                    ],
                ],
            ],
        ],
  • r

    Rayderxx

    05/20/2021, 7:59 AM
    ok thx !
  • u

    user

    05/20/2021, 10:19 AM
    https://github.com/area17/twill/discussions/907?sort=new#discussioncomment-762604
  • i

    ifox

    05/20/2021, 10:35 AM
    very cool
  • d

    Dmi3yy

    05/20/2021, 1:12 PM
    but medias work only if single image. If you want add like gallery then not saved
  • i

    ifox

    05/20/2021, 1:15 PM
    interesting. that should be possible, but i can see how it might not work. settings were built without support for complex fields initially, they would need to be refactored. If you want to avoid these limitations I would suggest creating a regular module.
  • r

    Rayderxx

    05/20/2021, 1:15 PM
    I can't get it work 😄
  • r

    Rayderxx

    05/20/2021, 1:16 PM
    Yep that's what I did ...
  • d

    Dmi3yy

    05/20/2021, 1:17 PM
    maybe this help https://tppr.me/dXvgt
  • d

    Dmi3yy

    05/20/2021, 1:18 PM
    after try to save in settings table multi rows with _id
  • d

    Dmi3yy

    05/20/2021, 1:22 PM
    Using such things as pictures, files, blocks in the settings solves the problem when you need to assemble simple pages with any set of fields. For example, I have only 1 gallery on the main project. And on the page with the contract, a couple of text blocks + a couple of files And for this it is not very advisable to use a standard module. Since for 2 records we will create 2 tables in the database + you need to edit the config and settings a little more so that in the menu you can get links directly to these documents
  • d

    Dmi3yy

    05/20/2021, 1:26 PM
    some samples, not Twill but the same logic for settings https://tppr.me/z29wi https://tppr.me/7mhhl https://tppr.me/s9JiS
  • i

    ifox

    05/20/2021, 1:33 PM
    totally agree we need support for all that in settings, but at the moment they are limited. there are ways to setup a module to be similar to settings though with json fields.
  • d

    Dmi3yy

    05/20/2021, 1:44 PM
    Somethink like that maybe was good: Standart module with one json field (there was store all not standart fields) + one param with name Layout + dependent fields (changes when we change layout)
  • d

    Dmi3yy

    05/20/2021, 1:49 PM
    And if we add nesting to this module, then we get a complete structure as in the MODX CMS ))
  • d

    Dmi3yy

    05/20/2021, 2:22 PM
    now do with raw in settings and use module https://tppr.me/J4pgS
  • d

    Dmi3yy

    05/20/2021, 2:23 PM
    but after edit, sub menu is hidded, it is logical but can i change this?
  • i

    ifox

    05/20/2021, 2:23 PM
    hidden? or inactive?
  • d

    Dmi3yy

    05/20/2021, 2:24 PM
    https://tppr.me/tKglK
  • d

    Dmi3yy

    05/20/2021, 2:24 PM
    https://tppr.me/QpE5
  • d

    Dmi3yy

    05/20/2021, 2:25 PM
    its logical becouse i not inside settings now
  • d

    Dmi3yy

    05/20/2021, 2:25 PM
    or this variant not good practice?
  • d

    Dmi3yy

    05/20/2021, 2:27 PM
    I apologize for many stupid questions, I will pull up a little knowledge and after that I will help and not just ask
  • i

    ifox

    05/20/2021, 2:28 PM
    those are not stupid questions, no worries @User!
  • i

    ifox

    05/20/2021, 2:28 PM
    I see, thanks for the screenshot
  • i

    ifox

    05/20/2021, 2:29 PM
    that's definitely a bit outside of what the system expects 🙂
  • i

    ifox

    05/20/2021, 2:30 PM
    you can however register a route that would make it work
  • i

    ifox

    05/20/2021, 2:30 PM
    with an action that basically do what
    edit
    does on the module
  • i

    ifox

    05/20/2021, 2:31 PM
    so you would register
    /admin/settings/your_custom_settings_form_from_a_module
  • d

    Dmi3yy

    05/20/2021, 2:31 PM
    yep i see this on discussions, will try
1...8910...484Latest