Skip to content
This repository has been archived by the owner on Feb 24, 2023. It is now read-only.

Commit

Permalink
Fixed loading template paths.
Browse files Browse the repository at this point in the history
  • Loading branch information
seehat committed Dec 19, 2022
1 parent ffa94cf commit 00d7592
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "amteich/kirby-twig",
"description": "Twig templating support for Kirby CMS",
"type": "kirby-plugin",
"version": "4.2.1",
"version": "4.2.2",
"license": "MIT",
"authors": [
{
Expand Down
7 changes: 7 additions & 0 deletions src/classes/Environment.php
Original file line number Diff line number Diff line change
Expand Up @@ -170,6 +170,13 @@ public function __construct(string $viewPath = '')
}
}

// add plugin template paths
foreach ($kirby->extensions('templates') as $templatepath => $root) {
if (Str::endsWith(strtolower($root), '.twig')) {
$loader->addPath(str_replace($templatepath . '.twig', '', $root));
}
}

// is viewpath in a plugin, add the pluginpath
if ($viewPath != $this->templateDir) {
$loader->addPath($viewPath);
Expand Down

0 comments on commit 00d7592

Please sign in to comment.