Is there a function similar to this?
The result of it should be the full page html.
The alternative would be to run cURL, but it would probably be much faster if it was possible to get it “from the inside”.
If it does not exist, would it be a good thing to add? Is there another better way than using cURL to get a page by url html result?
You can achieve something like this with a combination of
Take a look at how the StaticBuilder plugin by @fvsch does it. I don’t know however if that would work inside another template as
$site->visit() might break the state of the current page.
This works for me…
$kirby = new Kirby();
echo $kirby->render( page( $id ) );
I don’t know if I need to use
visit for something? Seems to work anyway.
Great that it’s working for you.
And I changed my mind. I had trouble to get the render function work with multi languages so I managed to use
visit instead. I was inside a route so this worked (in the
return site()->visit( $id, $language); ?>
visit is needed if you want
$page->isActive() to work.