Accessing parent folder using the file: tag

I’m evaluating Kirby for my company homepage. I created a folder structure for my products, similar like this:


Normally I put all related documents, datasheets, manuals etc. into the respective product folder.

It is now so that some products share the same datasheet, which I would like to place only once into the “1-seriesA” folder. Also I created a nice little table where I offer my downloads combined with a PDF icon.

Now, to access the shared files, I tried (image: …/pdficon.gif) to link to the parent folder, which works fine.

However, (file: …/mydatasheet.pdf) does not work any. Seems id does not understand the …/ path.

You have to use the path to the file:

(file: parentfolder/filename)

Ok, I did some more tests. It seems like the (file:) tag supports neither the absolute path nor the relative path. It only supports files in the very same directory.
While the (image: ) tag supports both of them.

An absolute path could be /content/1-products/1-categoryA/1-seriesA/file.pdf
A relative path could be …/file.pdf

If you want to access a file in seriesA from the product one page, this would be the way to go:

(file: seriesA/product1.pdf)

Do not use the complete path starting from /content.

Thank you texnixe,
I see I have to omit the folder numbering. I get something to work from the product1 folder like:
(without /content and without numbers)

but seriesA/file.pdf does not work for me.

1 Like

Oh, yes, sorry, you have to provide the full path, of course. Probably not my day today :confused:

I wish the (file: ) tag would accept relative paths in the same way like the (image: ) tag does.

If I ever have to reorder or extend my product tree, I would also have to match all the links in my markdown files.

Edit: There seem to be completely different path handling in file: and image: tag. The image: tag, for absolute paths, will not work without the /content root folder.