theme_var() twig function now checks page header var first

This commit is contained in:
Andy Miller
2018-03-02 15:39:59 -06:00
parent 5ffe32ef58
commit 54cd7f85b8
2 changed files with 4 additions and 1 deletions

View File

@@ -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)

View File

@@ -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);
}
/**