->url() is providing a "file://" urls instead of actual file's url

I am currently building my first Kirby template for a project. Everything works nicely so far except for one thing I don’t understand.

On some pages, when using ->url() to bring cover pictures, it returns a “file://” URL instead of the real URL. Why is that ? There is something is surely don’t get, as a novice developper I am a bit lost.

I couldn’t find any answer in the documentation, I was wondering if somebody here can point me the direction to a solution.

Thanks in advance :slight_smile:

Am I right in assuming you are trying to fetch a file from a files field? Then you have to convert the value stored in the field (the file UUID) to a file object first, see example in the documentation:

Almost every field type that is supposed to be rendered in the front-end has an example how to correctly render values from those fields.

2 Likes