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

    pboivin

    07/09/2021, 6:19 PM
    Ah, nice menu editor! For some reason, I was thinking about a restaurant menu 😋 I think you would need a different approach for the nested menu items, which would be attached to other menu items and not the parent menu directly.
  • p

    pboivin

    07/09/2021, 6:26 PM
    Scratch that. Actually yeah, I think you could use the same approach. A menu_item_id foreign key on MenuItem + repeater hooks in the MenuItemRepository might do the trick.
  • b

    bwaltz6

    07/09/2021, 6:33 PM
    let me try
  • p

    pboivin

    07/09/2021, 6:36 PM
    I believe you'll need to make your menu_id fk nullable (ie. optional)
  • b

    bwaltz6

    07/09/2021, 6:37 PM
    maybe both menu_id and menu_item_id will need to be nullable
  • p

    pboivin

    07/09/2021, 6:37 PM
    Yeah, makes sense
  • b

    bwaltz6

    07/09/2021, 6:38 PM
    is there a way to use the nested set package like other nested modules?
  • p

    pboivin

    07/09/2021, 6:42 PM
    That's a great idea. I believe you'll be writing your own logic in
    afterSave
    instead of relying on
    updateRepeater
    but the package has a really nice API.
  • b

    bwaltz6

    07/09/2021, 6:42 PM
    ok
  • l

    Luís Novais

    07/10/2021, 11:24 AM
    You have resolved that ? I have the same question ...
  • l

    Luís Novais

    07/10/2021, 11:27 AM
    How can I display cropped image in frontend ? Always show the largest image ... {!!$featured->image('cover', 'mobile')!!}
  • v

    void

    07/10/2021, 11:30 AM
    Hi @User Have you set in your model the mediaParams? and HasMedias trait?
  • v

    void

    07/10/2021, 11:31 AM
    Copy code
    php
        public $mediasParams = [
            'cover' => [
                'desktop' => [
                    [
                        'name' => 'desktop',
                        'ratio' => 3 / 2,
                    ],
                ],
                'mobile' => [
                    [
                        'name' => 'mobile',
                        'ratio' => 9 / 4,
                    ],
                ],
            ],
            'slideshow' => [
                'desktop' => [
                    [
                        'name' => 'desktop',
                        'ratio' => 3 / 2,
                    ],
                ],
            ]
        ];
  • v

    void

    07/10/2021, 11:32 AM
    you can also try passing an arrey to ->image() like this and see if that works?
    Copy code
    php
    ->image('cover', 'mobile', ['w' => 1440, 'fm' => 'jpeg', 'q' => 70])
  • l

    Luís Novais

    07/10/2021, 11:37 AM
    Yes I have the mediaParams and HasMedias, I try "->image('cover', 'mobile', ['w' => 1440, 'fm' => 'jpeg', 'q' => 70])" but keep showing the full image and not cropped image I'm using the glid service
  • v

    void

    07/10/2021, 12:47 PM
    @User did u managed to sort (solve) it out?
  • i

    ifox

    07/10/2021, 12:49 PM
    @Luís Novais are you seeing new files generated by glide in the storage/app folder?
  • v

    void

    07/10/2021, 12:50 PM
    My last commit in my new L8 + Twill projcet seem to work fine https://github.com/voidfire/lig/commits/main
  • v

    void

    07/10/2021, 12:51 PM
    as long as I crop the image requests and publish/update the resource on twill's panel first
  • l

    Luís Novais

    07/10/2021, 1:01 PM
    No, the image is not created in cropped size
  • l

    Luís Novais

    07/10/2021, 1:01 PM
    No i'm not sorting
  • l

    Luís Novais

    07/10/2021, 1:02 PM
    No, keep trying to solve that
  • v

    void

    07/10/2021, 1:03 PM
    Jump in the General voice channel for a sec?
  • v

    void

    07/10/2021, 1:05 PM
    nvm, are you cropping the image in the admin panel then update/publish the resource?
  • l

    Luís Novais

    07/10/2021, 1:08 PM
    image('cover', 'default', ['w' => 500, 'fm' => 'jpeg', 'q' => 100]) !!}" alt="" srcset=""> image('cover', 'default') !!}" alt="" srcset=""> image('cover', 'mobile') !!}" alt="" srcset="">
  • l

    Luís Novais

    07/10/2021, 1:08 PM
    try all off this and don't work
  • v

    void

    07/10/2021, 1:10 PM
    what do you get if you just output
  • v

    void

    07/10/2021, 1:10 PM
    {!! $featured->image('cover', 'mobile') !!}
  • v

    void

    07/10/2021, 1:10 PM
    should be getting a /img/ path
  • l

    Luís Novais

    07/10/2021, 1:12 PM
    getting this /storage/e0801076-b966-4f89-a92f-b330cc77cc24/destaque-image.jpg?fm=jpg&q=80&fit=max&crop=514%2C514%2C105%2C0
1...585960...484Latest