Accessing parent folder using the image: tag - Kirby 3

Hi.

I have several subpages (or articles) which may or not share some images.

So best practice would be to place this pictures in the parent folder.

I thought (image: …/pic-name1.jpg) would solved it, but I guess the routing mechanism is capturing this and returning a not found error.

Any workaround to this?

Thank you.
Daniel Santos.

Are you adding these tags manually instead of via the image button? If you select a file via the dialog, it automatically adds the correct path.

Not sure what is the image button, I’m using the standard editor.

Ah yes.

I tried that but the dialog is showing only the files in the page’s folder.

I would need to access files from the parent folder.

You can use the files option to set where your image should come from.

files: page.parent.images

Seems to work, thanks.

Now if I would want to add the current folder also

page.image

how would I add it to the option?

files: page.parent.images.add(page.images)
1 Like

That’s perfect.

Thank you for your help Sonja.