Weird warning in homepage of plainkit 5.03

Good evennig everybody,
I just installed a K5-plainkit. Worked on blueprints, everything seemed to be ok.
But then I added

<?= snippet('header'); ?>

(which is present and contains only html so far) to the default template and now I get this Error when opening the homepage:

What does that mean? I’m not using composer, I downloaded the zipfile.

You need to run composer on the installation to finish it up. The vendor folder is missing, and Kirby is trying to load something from it. Install composer, and run composer install in the root of the project where composer.json is located.

The vendor folder gets generated by composer and makes it easier to update kirby and install plugins and keep them updated as well. Gonig forward you can just run `composer upgrade` in the root which will update kirby and any plugins installed via composer to their latest versions.

Oh, thats, mhm…
I never needed composer until now. And the website is hosted on a server I only have ftp-access to.

Can I run the install-process localy on a linux- machine and then copy the kirby-directory to the webserver?

From where did you load the plainkit?

You don’t need composer to use the plainkit.

I downloaded it from https://getkirby.com/try > Download ZIP

Ok, that download is complete, nothing missing. And as you wrote in your first post, it worked fine before you made any changes, is that correct? Then the error must be caused by something else.

Could you please post the full code of your resulting default.php template after the changes, and the code of the header snippet you wanted to include.

I just downloaded the plainkit zip file, didnt do anything with composer, and setup a header snippet with just heading tag in it and it didnt trigger a call to something in the vendor folder. It ran as expected. So, something else must be going on here.

1 Like

This

<?= snippet('header'); ?>

Should be

<?php snippet('header'); ?>

Well, yes, no reason to echo the snippet method, but that is not responsible for the error message.

This:

is taken from the cookbook. It should work and it has already :wink:

Thank you all for your hints and helps. I took a shortcut to solving the problem, downloaded a fresh plainkit and copied the kirby directory. Now it works.
That tells me, that probably I produced the problem myself be deleting or moving something accidentely.
Forgive me for stealing your time…

Ralf

Wondering where you found that syntax used.

You are right. It’s not in the cookbook and not about snippet().

But in the reference I found this css() | Kirby CMS and used it with snippet() instead. Looks pretty similar, doesn’t it?

Regards,

Ralf

Yes, there is a difference:

Functions that return a value (css(), js(), etc.)
<?= ... ?>

Functions that output something themselves (snippet(), kirbytag(), …)
<?php ... ?>

Thank you for the clarification!
I should have known/remembered :man_facepalming:.

I’m a Feierabend-Entwickler, not a professional. I’m spending to little time in coding and I simply have forgotten this simple point.
So thank you again.