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

    ifox

    06/09/2022, 8:09 AM
    I gave you the condition. Put it in a variable and then use it to know if you should call twill image
  • i

    ifox

    06/09/2022, 8:09 AM
    as in, don't call twill image if the condition I shared is false
  • i

    ifox

    06/09/2022, 8:10 AM
    if you can paste your blade file instead of a screenshot i can show you where to put it...
  • m

    mateoD

    06/09/2022, 8:12 AM
    @php $title = $block->translatedInput('title'); $description = $block->input('description'); $align = $block->input('align'); $id = $block->input('id'); if ($block->hasImage('image')){ $image = TwillImage::make($block, 'image'); $image->preset('image'); } @endphp {{-- md:py-10 --}} <div class="max-w-xl md:max-w-none md:w-full mx-auto md:col-span-5 lg:col-span-6 mb-8 md:mb-0 md:{{$align}}" data-aos="fade-up"> @if($block->hasImage('image')) {!! TWillImage::render($image) !!} @endif <div class="max-w-xl md:max-w-none md:w-full mx-auto md:col-span-7 lg:col-span-6" data-aos="fade-right"> {{$title}} {!!$description!!}
  • i

    ifox

    06/09/2022, 8:13 AM
    outside if the fact that you're calling hasImage twice, this should work
  • i

    ifox

    06/09/2022, 8:14 AM
    so what is the issue? Is hasImage true even though you didn't select an image?
  • m

    mateoD

    06/09/2022, 8:15 AM
    now i doesent fail when there's no image, but when image is loaded is not rendered
  • m

    mateoD

    06/09/2022, 8:18 AM
    this condition if ($block->hasImage('image')) is not working at all
  • m

    mateoD

    06/09/2022, 8:19 AM
    it always return false
  • k

    kalle

    06/09/2022, 8:19 AM
    Check your Facade. Currently its
    TWillImage
    ->
    TwillImage
  • m

    mateoD

    06/09/2022, 11:03 AM
    I am doing some edits in twill but I do not see the changes in parallel in the editor view , do you have any idea how can i fix it to see my changes parallel ?
  • i

    ifox

    06/09/2022, 11:04 AM
    did you set up your block preview layout? are your blocks rendering correctly outside of the editor? do you see network errors in the console when Twill is trying to get the preview?
  • m

    mateoD

    06/09/2022, 11:07 AM
    yes they're rendering correctly outside editor,but at time i am editing previw in right of image stays black
  • k

    kalle

    06/09/2022, 11:20 AM
    Can you actually check DOM and see which elements/ CSS classes sets that black colour? Its not logical at all, first time seeing this type of issue.
  • d

    dedli

    06/09/2022, 1:49 PM
    Hi guys ) What is the best practice to build breadcrumbs? Is it any build in methods for example to get all slugs, or I should parse url as string? Or maybe there are another ways to build breadcrumbs?
  • i

    ifox

    06/09/2022, 1:51 PM
    Hi @dedli breadcrumbs on a single content type or cross types? if it's on a module that uses HasNesting, you can use some of these: https://twill.io/docs/api/2.x/A17/Twill/Models/Behaviors/HasNesting.html
  • i

    ifox

    06/09/2022, 1:52 PM
    Copy code
    getNestedSlug(string|null $locale = null)
    Returns the combined slug for this item including all ancestors.
  • i

    ifox

    06/09/2022, 1:53 PM
    https://github.com/area17/twill/pull/1222
  • u

    24kappa

    06/09/2022, 1:55 PM
    Hi guys, I've just deployed my twill installation on production but i have some problems with media library. The application is able to upload the images/files (i can see all of them in the uploads folder) but they are not showed on fronted, they are all in 404. I'm using GLIDE with LOCAL and the route '/img/599a6d3d-ed3a-4e86-b9b5-1c1636cbac69/app-development-2.png?auto=compress%2Cformat&q=90&dpr=1&h=256' is redirect to homepage. Any idea on what I'm missing?
  • d

    dedli

    06/09/2022, 2:09 PM
    No it is not single content types, there are a lot of different modules and they not nested. They connected with parent id. I can get Route::current(); and parse it by '/' and then build links from slugs that i will get or it is a bad idea?
    i
    • 2
    • 2
  • e

    ermyril

    06/09/2022, 2:23 PM
    Hi guys, can someone please point me to some info on how to use translated media fields?
    i
    • 2
    • 5
  • i

    ifox

    06/09/2022, 2:28 PM
    what is this image app-development.png you're all using haha https://discord.com/channels/811936425858695198/873445927740903475/984430256570118154
  • i

    ifox

    06/09/2022, 2:29 PM
    @24kappa are image generated in the
    glide_cache
    folder? did you run
    storage:link
    ? any errors beyond 404?
  • i

    ifox

    06/09/2022, 2:30 PM
    Breadcrumbs
  • u

    24kappa

    06/09/2022, 2:33 PM
    i've run
    storage:link
    and I've just noticed in
    glide_cache
    folder there is just one folder. Maybe i'm missing some configuration? No errors beyond 404, i've noticed just a 301 redirect on request
  • c

    ckmirafss

    06/10/2022, 12:49 AM
    Hey @Harings Rob , I tried these but still gets the same error.
  • c

    ckmirafss

    06/10/2022, 1:13 AM
    New issues I've encountered
  • h

    Harings Rob

    06/10/2022, 6:05 AM
    You do not have to add anything to the block editor config for this normally.
  • h

    Harings Rob

    06/10/2022, 6:05 AM
    So first remove that entry again.
  • k

    kalle

    06/10/2022, 5:59 PM
    Any idea why file wont append to the file input?
    $filesParams
    role set, Model and Repo have traits. Any debug idea? 2.8.0v Locale not problem It seems that method
    afterSaveHandleFiles
    which attaches file to fileables pivot is not invoked at all.
1...341342343...484Latest