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

    Kormi

    05/31/2022, 1:33 PM
    Copy code
    public function prepareFieldsBeforeSave($object, $fields)
        {
            Mail::send('twill::emails.html.email', [
                'url' => '#',
                'actionText' => twillTrans('twill::lang.notifications.reset.action'),
                'copy' => twillTrans('twill::lang.notifications.reset.content'),
            ], function ($message){
                $message->to('info@kormiwebsolutions.it');
                $message->subject(twillTrans('twill::lang.notifications.reset.subject', [
                    'appName' => config('app.name')
                ]));
            });
    
            return parent::prepareFieldsBeforeSave($object, $fields);  
        }
    the email never arrives. Also if I put a dd() ... from the console I still see that the response returns something
  • k

    kalle

    05/31/2022, 1:34 PM
    Ok that is diffrent method https://github.com/area17/twill/blob/2b21d9a67d70ed81ce5bb5af9e34176441824825/src/Http/Controllers/Admin/ModuleController.php#L650
  • k

    kalle

    05/31/2022, 1:34 PM
    Try to publish it from the form.
  • k

    Kormi

    05/31/2022, 1:35 PM
    i do not want to use edit form
  • k

    Kormi

    05/31/2022, 1:35 PM
    Admins can only publish or delete user profiles from main table
  • k

    kalle

    05/31/2022, 1:37 PM
    Try to override this method in your Controller
  • k

    kalle

    05/31/2022, 1:47 PM
    Also this method fires event
    cms-module.saved
    when module is saved, but from that you can't get which model is updated.
  • u

    24C Felix

    05/31/2022, 4:12 PM
    Hello there! (insert Obi-Wan GIF) Is there any possiblity to retrieve all media (e.g. images) to show it in a blade view?
  • h

    Harings Rob

    05/31/2022, 4:30 PM
    @24C Felix of a specific model or just Media::get()?
  • u

    24C Felix

    05/31/2022, 4:33 PM
    Just all media in the database. E.g. for list of photo credit
  • h

    Harings Rob

    05/31/2022, 4:35 PM
    Then you can do Media::all();, it wont have set crops so if you have to do that yourself.
  • u

    24C Felix

    05/31/2022, 4:43 PM
    Can I access the meta data like that?
  • i

    ifox

    05/31/2022, 7:01 PM
    which metadata @24C Felix? You'll have access to caption and alternative text, image dimensions, filename
  • i

    ifox

    05/31/2022, 7:03 PM
    if you're looking for the pivot metadata, as in the caption or alt text that is provided when attaching an image to some record/block, you have to query the
    mediables
    table
  • u

    24C Felix

    05/31/2022, 7:38 PM
    So when adding custom meta data I have to query the mediables table, right?
  • i

    ifox

    05/31/2022, 7:39 PM
    if you want the content of the fields in the media library sidebar, they are all in the medias table. If you want the pivot metadata for each instance of an image being attached to some content, it'd be in the mediables table.
  • i

    ifox

    05/31/2022, 7:40 PM
    custom metadata fields apply to both
  • u

    24C Felix

    05/31/2022, 7:41 PM
    🤦🏻‍♂️ okay. Actually I was kinda stuck I guess. Thanks anyway! 😅
  • d

    dedli

    06/01/2022, 6:51 AM
    Hi, i have blocks on site witch with the static conten witch not depend on page. What the best practice for this? Create singleton and put it inside settings and fill this global static blocks there?
  • h

    Harings Rob

    06/01/2022, 6:53 AM
    Hey @dedli that seems like a good approach yes. I think you will want to load the contents of that singleton into the block?
  • d

    dedli

    06/01/2022, 7:31 AM
    Yes, or such way, or create in singleton named blocks and load to my universal blocks on page data from blocks from singleton settings
  • h

    Harings Rob

    06/01/2022, 7:32 AM
    Well, you cannot have predefined blocks at the moment.
  • h

    Harings Rob

    06/01/2022, 7:32 AM
    so what you would have to do is create content and then generate the block or create a block for each content.
  • d

    dedli

    06/01/2022, 7:40 AM
    I think to do something like this in my singleton:
    Copy code
    @formField('block_editor', [
        'label' => 'Blok1',
        'name' => 'bock1',
        'blocks' => ['block1']
        ])
        @formField('block_editor', [
        'label' => 'Blok2',
        'name' => 'bock2',
        'blocks' => ['block2']
        ])
    and so on
    Or it is a bad way and better to put all data into the content of singleton and group them by sections? Is it possible to limit by one block of one type?
  • h

    Harings Rob

    06/01/2022, 8:08 AM
    I guess your strategy is fine, however I am not 100% sure as I never did something similar.
  • d

    dedli

    06/01/2022, 8:38 AM
    Thanks! I will try )
  • d

    dedli

    06/01/2022, 9:09 AM
    Is it possible to duplicate block with inner content? When I copy it it is copy only structure
  • i

    ifox

    06/01/2022, 9:18 AM
    "Create another" would do that, "duplicate" is supposed to duplicate values as well, is it not?
  • d

    dedli

    06/01/2022, 11:27 AM
    There is clone block option and it is clone only structure without content https://monosnap.com/file/5IjPEYYzzut2fN03Dk3m48ZkrC5muE
  • i

    ifox

    06/01/2022, 11:28 AM
    oh ok this is a repeater within a block
1...335336337...484Latest