amteich / kirby-twig

Twig templating support for Kirby CMS
MIT License
48 stars 12 forks source link

Custom namespaces not working in Kirby 3.4.2 #14

Closed jimhaakman closed 4 years ago

jimhaakman commented 4 years ago

Hi, I'm getting an error when using custom namespaces with Kirby 3.4.2.

Twig\Error\LoaderError

Line 1 of /home/ubuntu/sites/project/assets/pages/home.twig

There are no registered paths for namespace "layouts".

In config:

'mgfagency.twig.namespace.layouts' => ROOT_PATH . '/assets/layouts',

Thank you!

seehat commented 4 years ago

Hi, sry for this error. It was caused by the changes concerning the Kirby error concerning config options. It should be fixed in 2.0.1 with a little different syntax:

'mgfagency.twig.namespaces' => [
  'layouts' => ROOT_PATH . '/assets/layouts',
],

Thank you for posting. Please tell me if it works now.

jimhaakman commented 4 years ago

Yes it is working perfectly, thank you very much!

seehat commented 4 years ago

You're welcome.