Hi.
How do I render a page on demand with its default template?
My code is:
public function onAfterWrite() {
parent::onAfterWrite();
$render = $this->renderWith(array($this->ClassName,'Page')));
}
Saving the page gives me the following error:
500//ERROR [User Warning]: None of these templates can be found in theme '': MainPage.ss, Page.ss IN POST /admin/EditForm Line 207 in /var/www/vhosts/orange.czterystacztery.pl/htdocs/sapphire/core/SSViewer.php
As you can see, current theme name variable is surprisingly empty, although I use set_current_theme() in config.php
All I need to do is export my page into a static file. But I am unable to get its published content.
What am I doing wrong?
Is there any method to render a page with its default template? Like $this->render() and not $this->renderWith()