mirror of
https://github.com/getgrav/grav.git
synced 2025-02-20 19:56:53 +01:00
fix for rendering specific templates fixes #3698
This commit is contained in:
parent
3e6c719441
commit
72b769aa63
|
|
@ -1,3 +1,9 @@
|
|||
# v1.7.40
|
||||
## 02/dd/2023
|
||||
|
||||
1. [](#bugfix)
|
||||
* Fix for overzealous modular page template rendering fix in 1.7.39 causing Feed plugin to break [#3689](https://github.com/getgrav/grav/issues/3689)
|
||||
|
||||
# v1.7.39.2
|
||||
## 02/20/2023
|
||||
|
||||
|
|
|
|||
|
|
@ -493,13 +493,19 @@ class Twig
|
|||
/**
|
||||
* Simple helper method to get the twig template if it has already been set, else return
|
||||
* the one being passed in
|
||||
* NOTE: Modular pages that are injected should not use this pre-set template as it's usually set at the page level
|
||||
*
|
||||
* @param string $template the template name
|
||||
* @param PageInterface $page the template name
|
||||
* @return string the template name
|
||||
*/
|
||||
public function template($template)
|
||||
public function template(PageInterface $page, string $extension): string
|
||||
{
|
||||
return $this->template ?? $template;
|
||||
$template = $page->template() . $extension;
|
||||
if ($page->isModule()) {
|
||||
return $template;
|
||||
} else {
|
||||
return $this->template ?? $template;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -513,7 +519,8 @@ class Twig
|
|||
$default = $page->isModule() ? 'modular/default' : 'default';
|
||||
$extension = $format ?: $page->templateFormat();
|
||||
$twig_extension = $extension ? '.'. $extension .TWIG_EXT : TEMPLATE_EXT;
|
||||
$template_file = $template . $twig_extension;
|
||||
// $template_file = $template . $twig_extension;
|
||||
$template_file = $this->template($page, $twig_extension);
|
||||
|
||||
// TODO: no longer needed in Twig 3.
|
||||
/** @var ExistsLoaderInterface $loader */
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user