I know you can get the $page
folder name with sorting number using $page->dirname()
or $page->diruri()
for the current folder (e.g. 1_foldername
). If I use something like $page->id()
, I get the nesting, but not the sorting numbers present in the folder names.
How do I get the full path to the current page with sorting numbers on all the parent folder? e.g. (/2_grandparent/3_parent/4_child/1_foldername
)
Is there a Kirby method to do this or do I have to go through each segment of $page->id()
and dirname()
on it in order to build the absolute path? Or do you have a better idea?
The reason I need that absolute file path is to give to F::write
in order to create an image file in the page folder from an image Byte array from an API.