mirror of
https://github.com/getgrav/grav.git
synced 2026-05-06 07:15:27 +02:00
theme_var() twig function now checks page header var first
This commit is contained in:
@@ -13,6 +13,7 @@
|
||||
1. [](#improved)
|
||||
* Vendor library updated to latest
|
||||
* Improved `Session` initialization
|
||||
* Added ability to set a `theme_var()` option in page frontmatter
|
||||
1. [](#bugfix)
|
||||
* Fixed issue with image alt tag always getting empted out unless set in markdown
|
||||
* Fixed issue with remote PHP version determination for Grav updates [#1883](https://github.com/getgrav/grav/issues/1883)
|
||||
|
||||
@@ -1129,7 +1129,9 @@ class TwigExtension extends \Twig_Extension implements \Twig_Extension_GlobalsIn
|
||||
*/
|
||||
public function themeVarFunc($var, $default = null)
|
||||
{
|
||||
return $this->config->get('theme.' . $var, $default);
|
||||
$header = $this->grav['page']->header();
|
||||
$header_classes = isset($header->$var) ? $header->$var : null;
|
||||
return $header_classes ?: $this->config->get('theme.' . $var, $default);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user