Let’s say I got a string with Kirby content txt file data inside it.
Can I merge it with the $page object? How? Are there any good functions I can use for it?
The “Kirby way” would be:
That content should live in your page’s main
txt file. That way it can be edited in the panel, is already “merged” in the $page object, etc.
If that’s not desirable, create a child page:
And maybe create a
module.php controller that redirects HTTP requests to the parent page, so that this child page cannot be shown.
I’m experimenting with transporting data between two Kirby installations and I see now that your idea would probably be the best one.
My plan now would be something like this:
- From the other installation add routes to make the txt files accessible from the outside.
- Download the content to the main Kirby installation content folder.
- Let the content be in a special folder like
data that shows an error page for normal users, but accessable from the templates.
- Access the content with like