I’m following the Quick Tip guide on how to share templates, but I’m not having any luck with it.
Link: Sharing templates across blueprints | Kirby CMS
- I’ve set up the plugin folder as such:
site/plugins/sharedtemplates/
- in it I have a
index.php
file with the following code:
<?php
use Kirby\Cms\App as Kirby;
Kirby::plugin('studio/sharedtemplates', [
'templates' => [
'work' => __DIR__ . '/templates/about.php',
]
]);
- I’ve double checked that I have the about.php template in my site template directory
site/templates/about.php
- When I go to example.com/work I would expect it to use the about.php template but it just uses the work.php template, and when I remove the work.php template it used the default template.
I’m doing this on local development if that has any effect on it, but I’m rather lost for what I’m doing wrong so any suggestions would be appreciated!!!
thank you in advance
Side question:
Is it not possible to include the:
'templates' => [
'work' => __DIR__ . '/templates/about.php',
]
directly in the config file? - just asking as having the plugin folder just to assign templates seems a bit much