Added ability to render front-end templates in markdown preview #185

This commit is contained in:
Andy Miller
2015-09-17 11:41:14 -06:00
parent ccf5b15a97
commit 1c7928a114

View File

@@ -667,6 +667,11 @@ class AdminController
$this->preparePage($page, true);
$page->header();
// Add theme template paths to Twig loader
$template_paths = $this->grav['locator']->findResources('theme://templates');
$loader_chain = $this->grav['twig']->twig->getLoader()->addLoader(new \Twig_Loader_Filesystem($template_paths));
$html = $page->content();
$this->admin->json_response = ['status' => 'success', 'message' => $html];