StarterKit : images display only after reload page in the browser

Okay. I manage to reproduce the problem with a starterkit 3.8.3.

Probably something wrong in the /blueprints folder in a site.xxx.yml file

It’s strange, as soon as I create an empty plugins/programmable-blueprints folder, it prevents the images from loading

Can you reproduce this in a fresh Starterkit?

I uploaded a new starterkit

problem-plugin

  1. I created a folder programmable-blueprints with an index.php which contains:
<?php

use Kirby\Cms\App as Kirby;

Kirby::plugin('cookbook/programmable-blueprints', [
    'blueprints' => [
        'site' => function () {
            if (($user = kirby()->user()) && $user->isAdmin()) {
                return Data::read(__DIR__ . '/blueprints/site.admin.yml');
            }
        },
    ]
]);

in the plugins/programmable-blueprints/blueprints/site.admin.yml folder I copied what was in site/blueprints/site.yml

  1. If I rename: plugins/programmable-blueprints to plugins/_programmable-blueprints everything works.

this plugin is essential to make the programmable-blueprints plugin work?

No, not for the example we are discussing here.

But as I already wrote above, I cannot reproduce the issue you have with the programmable-blueprints plugin in my environment (MacOS Ventura, Laravel valet, PHP 8.0.23, Firefox)

Ok.

I’m also on mac. Mac Monterey. Chrome and Firefox. MAMP in PHP 8.0.8.

I’m trying but I’m having trouble understanding.

Hmmm hmm…i think i found it.

I let you confirm me.

I started the index.php code on the 2nd line (if I move the <?php tag to line number 1 it works again).

That should never be the case, make sure that all files start without any whitespace.

2 Likes

Thanks very much

WOW, this fixed it for me! My empty line was at the beginning of config.php…

I had the same issue and removing the newline at the top of my php file fix my problem too.

Same thing for me. One of my custom plugins started on line two. Works like a charm now. Thanks a lot.