Modular template extension follows the master page extension (#2044)

This commit is contained in:
Jean-Baptiste Alleaume
2018-06-09 00:00:07 +02:00
committed by Andy Miller
parent ab58cca3f7
commit 036fc2d2af

View File

@@ -238,7 +238,9 @@ class Twig
// Process Modular Twig
if ($item->modularTwig()) {
$twig_vars['content'] = $content;
$template = $item->template() . TEMPLATE_EXT;
$extension = $this->grav['uri']->extension();
$extension = $extension ? ".{$extension}.twig" : TEMPLATE_EXT;
$template = $item->template() . $extension;
$output = $content = $local_twig->render($template, $twig_vars);
}