I want to use an inline SVG that the user uploads via the panel. Is this the best way to do it:
$path = $page->illustration()->toFile()->id();
echo svg('content/' . $path);
It works, but it seems sketchy to specify the content folder like that.
I want to use an inline SVG that the user uploads via the panel. Is this the best way to do it:
$path = $page->illustration()->toFile()->id();
echo svg('content/' . $path);
It works, but it seems sketchy to specify the content folder like that.
I think you can use this to get the absolute file path to be passed to the helper function: https://getkirby.com/docs/reference/objects/file/root
Yep, that did it. Thanks!