Skip to content

Commit b129d2d

Browse files
author
Sebastien VIALLEMONTEIL
committed
We set twig variables for the "onTwigPageVariables" event in case the template is included in a page directly in which case twig variables are not set in some cases (ie: when shortcode plugin is enabled, that might be the case for other plugins involving page content ?)
1 parent 1a099b1 commit b129d2d

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

aboutme.php

+11
Original file line numberDiff line numberDiff line change
@@ -36,12 +36,23 @@ public function onPluginsInitialized()
3636
if ($this->config->get('plugins.aboutme.enabled')) {
3737
$this->enable([
3838
'onTwigTemplatePaths' => ['onTwigTemplatePaths', 0],
39+
'onTwigPageVariables' => ['onTwigPageVariables', 0],
3940
'onTwigSiteVariables' => ['onTwigSiteVariables', 0],
4041
'onAssetsInitialized' => ['onAssetsInitialized', 0]
4142
]);
4243
}
4344
}
4445

46+
/**
47+
* We set twig variable in case the template is included in a page and not in a theme template
48+
*
49+
* @param Event $e
50+
*/
51+
public function onTwigPageVariables(Event $e)
52+
{
53+
$this->onTwigSiteVariables();
54+
}
55+
4556
/**
4657
* Set variables for the template
4758
*/

0 commit comments

Comments
 (0)