mirror of
https://github.com/getgrav/grav-plugin-admin.git
synced 2025-11-01 19:06:16 +01:00
Added ability to render front-end templates in markdown preview #185
This commit is contained in:
@@ -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];
|
||||
|
||||
Reference in New Issue
Block a user