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

    jefsev

    02/10/2023, 8:21 PM
    @php $image = $widget->imageAsArray('image', 'default'); @endphp This is not working. And $widget->image('image') returnssomething but not rendered.
  • j

    jefsev

    02/10/2023, 8:21 PM
    $image = $widget->imageAsArray('image', 'desktop'); Also no luck.
  • j

    jefsev

    02/10/2023, 8:22 PM
    Copy code
    @foreach ($block->children as $widget)
                <x-img-card :widget="$widget" />
            @endforeach
  • j

    jefsev

    02/10/2023, 8:22 PM
    Copy code
    @php
        $image = $widget->imageAsArray('image', 'desktop');
    @endphp
    
    <a href="{{ $widget->translatedInput('button_link') }}"
        class="overflow-hidden rounded-lg shadow-xl hover:shadow-md duration-300 card">
        <img src="{{ $image['src'] }}" alt="{{ $image['alt'] }}" class="object-cover w-full h-80">
        <div class="flex flex-col items-start p-5 content">
            <div class="flex flex-row items-center mb-6 title gap-2">
                <img src="{{ $widget->file('icon') }}" class="icon w-7">
                <h4 class="mb-0">{!! $widget->translatedInput('title') !!}</h4>
            </div>
            <p class="mb-8 grow">{!! $widget->translatedInput('text') !!}</p>
            <span class="flex items-center px-6 py-3 font-medium text-white rounded-lg gap-3 bg-orange">
                {{ $widget->translatedInput('button_title') }}
                <svg xmlns="http://www.w3.org/2000/svg" width="7.008" height="14.016" viewBox="0 0 7.008 14.016">
                    <path id="Path_58" data-name="Path 58"
                        d="M2.656.875A.511.511,0,0,1,2.5.5.538.538,0,0,1,2.625.156L8.281-6,2.625-12.156a.51.51,0,0,1,.031-.719.51.51,0,0,1,.719.031l6,6.5a.535.535,0,0,1,0,.688l-6,6.5A.51.51,0,0,1,2.656.875Z"
                        transform="translate(-2.492 13.008)" fill="#fff" />
                </svg>
            </span>
        </div>
    </a>
  • j

    jefsev

    02/10/2023, 8:23 PM
    I'm kindoff lost on whats going wrong with this one
  • i

    ifox

    02/10/2023, 8:24 PM
    your crops config is missing a ratio (can be null or 0 for free crop) and you're using a different key than name for the crop name which makes things a bit confusing.
  • j

    jefsev

    02/10/2023, 8:25 PM
    Ah
  • j

    jefsev

    02/10/2023, 8:25 PM
    Like: "crop" => "free"
  • j

    jefsev

    02/10/2023, 8:26 PM
    'ratio' => 16 / 9,
  • j

    jefsev

    02/10/2023, 8:26 PM
    nvm im tired
  • j

    jefsev

    02/10/2023, 8:26 PM
    thx!
  • j

    jefsev

    02/10/2023, 8:35 PM
    Oke so weird. I get the same image in other blocks where they work fine
  • j

    jefsev

    02/10/2023, 8:35 PM
    Could it be something with @formField('repeater', ['type' => 'img-card']) ?
  • e

    EpicKau

    02/10/2023, 9:15 PM
    is this a bug or am I missing something?
  • i

    ifox

    02/10/2023, 9:15 PM
    Hi! Fixed in the last RC @EpicKau
  • i

    ifox

    02/10/2023, 9:15 PM
    oh sorry this is on the sidebar
  • i

    ifox

    02/10/2023, 9:16 PM
    so this might still be a bug
  • i

    ifox

    02/10/2023, 9:16 PM
    RC4 had a fix for forms without any fields in the "default" fieldset. might be that the sidebar has the same issue.
  • e

    EpicKau

    02/10/2023, 9:51 PM
    ah found it
  • j

    joshyhud

    02/11/2023, 12:55 PM
    Hi @ifox we were talking about twill and laravel 9 the other day and i sent your checks back to the development team and we are getting some error witn twill 2.12.4 on laravel 9 when using this cmd php artisan twill:build. we are receiving an sytenx error for token of ? in the vue.config.js file const host = process.env.APP_URL.split('//')[1] ?? process.env.APP_URL;
  • j

    joshyhud

    02/11/2023, 12:56 PM
    we have updated to twill version 2.12.4 and laravel 9 locally and this has worked fine. boith our local and server are on php 8.1.15 and we have installed the dependencies all from scratch in each occasion
  • i

    ifox

    02/11/2023, 1:01 PM
    The line you mention only runs if
    TWILL_DEV_MODE_SSH
    is set to true in your .env file, which you should only use with the dev mode on a local https domain secured by Valet.
  • i

    ifox

    02/11/2023, 1:01 PM
    https://github.com/area17/twill/blob/ff6c7ef8233a81626553042e475f900ae0416f68/vue.config.js#L169
  • j

    joshyhud

    02/11/2023, 1:02 PM
    let me check the .env and let you knwo
  • j

    joshyhud

    02/11/2023, 1:02 PM
    know
  • i

    ifox

    02/11/2023, 1:02 PM
    the dev mode is there for building custom Vue components. When building you shouldn't have dev mode and https enabled.
  • j

    joshyhud

    02/11/2023, 1:04 PM
    so i cannot see twill_dev_mode_ssh on the .env file on the server
  • j

    joshyhud

    02/11/2023, 1:05 PM
    also we havent used valet on this project either
  • i

    ifox

    02/11/2023, 1:05 PM
    See https://github.com/area17/twill/blob/ff6c7ef8233a81626553042e475f900ae0416f68/vue.config.js#L37
  • i

    ifox

    02/11/2023, 1:06 PM
    And https://github.com/area17/twill/blob/ff6c7ef8233a81626553042e475f900ae0416f68/vue.config.js#L167
1...464465466...484Latest