Skip to content

Commit

Permalink
Modular template extension follows the master page extension (#2044)
Browse files Browse the repository at this point in the history
  • Loading branch information
jbanety authored and rhukster committed Jun 8, 2018
1 parent ab58cca commit 036fc2d
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion system/src/Grav/Common/Twig/Twig.php
Original file line number Diff line number Diff line change
Expand Up @@ -238,7 +238,9 @@ public function processPage(Page $item, $content = null)
// 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);
}

Expand Down

0 comments on commit 036fc2d

Please sign in to comment.