Broken image URLs in Panel

When I upload an image via a custom blueprint, called Series, in Panel it gets correctly saved.
The image is being saved into content/ralph-the-mighty/ plus its associated text file.

However, in the Panel, the image’s URL keeps being wrong or not found, and it seems to be differently wrong in different places around the page…

Responsive image URLs…
Screenshot 2024-02-23 at 10.04.06 am

But the identified location is empty…

And if I inspect another instance…

Then there’s an extra folder inserted into the URL…?

So I’m not really sure what I’m looking at… whether it’s something to do with .htaccess, file permissions, or …something else…?

Thumbs are not generated, check with phpinfo() if gd is enabled and your version of gd supports webp

PHP is reporting the GD is enabled, and supports Webp…

What’s really weird is that those folders inside the media folder are completely empty, not even the jobs files are created.

What is your local development environment?

Beyond “MacOS” and “Terminal”… I’m not sure how to answer that question…?

Well, are you using PHP’s built-in server i.e. starting with php -S localhost:8000 kirby/router.php. Or are you using something like MAMP etc.

1 Like

Specifically invoking kirby/router.php seems to have done something – on the Series blueprint page in Panel, I’m now getting webp image thumbnails and the proper file view.
(Still not getting image thumbs in the Site blueprint in Panel, but that’s at least a separate problem which I can investigate).

For reference, when starting the localhost server, I had simply been calling php -S localhost:8000

Ok, that explains it, although I would have expected that in that case you wouldn’t even have access to the Panel and subpages wouldn’t work, either.

Hm. Could you post your site.yml blueprint?

Site.yml
(I’m aware the image query is very likely not the correct call on this page; just haven’t identified what the correct call should be yet…)

title: Site

# The layout of this form has two columns:
columns:

  - width: 2/2
    sections:
      #pages (most recent)
      #collections (draft + unlisted, sorted by most recent)

  - width: 1/2

    sections:

      series-active:
        headline: Series
        type: pages
        label: Active
        status: published
        templates: series
        layout: cardlets
        image: 
          query: page.images.template("cover").first
          cover: true
          ratio: 2/3

      series-inactive:
        type: pages
        label: Unreleased
        status: draft
        templates: series
        layout: list
        image: 
          query: page.images.template("cover").first
          cover: true


  - width: 1/2
  
    sections:
      pages:
        type: pages
        create: default
        templates:
          - about
          - home
          - default

Theoretically, the query should work, provided that the given page has an image with the template cover assigned. When you expect ralph1.webp.txt what do you see inside?

ralph1.webp.txt

Uuid: bWd1sim7mH8cR4dU

----

Focus: 27.1% 24.1%

(Focus is expected, I was goofing around with the file preview view earlier)

As I expected, no template assigned, so the image won’t show up

So you either need to assign a template at upload via the files section props, or you need to change your query and remove the template filter.

I’d recommend you check out the documentation regarding the files/pages section types:

2 Likes

In this instance, I think it’s going to be more correct to remove the template filter from the image query in the site.yml blueprint.

And simply removing the template filter means the thumbnail image appears inside the Cardlet layout.

Thanks so so much for your time and attention, @texnixe !

Ahh hahahahahah - just noticed this comment on the Local Development Environment cookbook page…

While using the built-in server works fine for many use cases, you might sometimes run into issues. We therefore don’t really recommend this environment.