is it possible to return the whole $page as string.
I want to load a page with ajax not only the data also the template.
What is the best way to do this?
I have my about.json.php file to load the page as json object, like this:
cool thanks alot, this works with every page! Without the about page
/about.json
Internal Server Error
The server encountered an internal error or misconfiguration and was unable to complete your request.
Please contact the server administrator at webmaster@ to inform them of the time this error occurred, and the actions you performed just before this error.
More information about this error may be available in the server error log.
<b>Fatal error</b>: Allowed memory size of 268435456 bytes exhausted (tried to allocate 32768 bytes) in <b>/kirby/vendor/filp/whoops/src/Whoops/Util/Misc.php</b> on line <b>1</b><br />
<b>Fatal error</b>: Allowed memory size of 268435456 bytes exhausted (tried to allocate 262144 bytes) in <b>/kirby/vendor/composer/ClassLoader.php</b> on line <b>329</b><br />
You probably need to increase the amount of ram available to PHP (in the php.ini file) - however you just managed to use 268 megabytes of ram! wha exactly is on the pages??? Thats pretty high. is there alot of images involved?
Yes, that might be the poblem. I think the render method is then called within the render method for the same page, resulting in the loop.maybe it would make sense to use routes rather then content reps here. But why do you need completely rendered templates instead of snippets?
we try to build the page loads with ajax but using the whole kirby cms to manage the content.
But yeah, you are right it’s also possible to just use snippets as page content templates.
And what’s about the routing, what is the best way for - route: page/about use home template with snippet about?