wanze / TemplateEngineTwig

A ProcessWire module adding Twig templates to the TemplateEngineFactory.
MIT License
12 stars 11 forks source link

FormBuilder and twig template #21

Closed mc72 closed 5 years ago

mc72 commented 5 years ago

Using v2 of twig and latest version of Form Builder pro module. When trying to display the easy embed (Iframe) method on a page, or in the backend, I get an error:

Error: Exception: Unable to find template "form-builder.twig" (looked into: /srv/users/serverpilot/apps/xxappnameremovedxx/public/site/templates/views). (in /srv/users/serverpilot/apps/xxappnameremovedxx/public/vendor/twig/twig/src/Loader/FilesystemLoader.php line 250)

Past versions of twig did not display this error and just displayed the form-builder.php code. I can't exclude the form-builder template in the Factory settings as it is a system template.

wanze commented 5 years ago

Hi @mc72

Thanks for the report! I think that the module should not exclude system templates in its configuration. I'll introduce this with the next release. To temporarily solve this problem, you could hook after TemplateEngineFactory::___shouldRenderPage and exclude any pages with the form-builder template from being rendered by Twig.

Here is an example how to setup the hook: https://github.com/wanze/TemplateEngineFactory/blob/master/DOCUMENTATION.md#___shouldrenderpage

Let me know if you need help with the hook or if you solved this in another way.

Cheers

wanze commented 5 years ago

Fixed with v2.0.1 - system templates can now be enabled/disabled in the TemplateEngineFactory module configuration.

gmclelland commented 4 years ago

Hey @wanze , thanks for fixing this. I just ran into this issue today. For some reason I'm not getting the module update notifications in the Processwire admin when I check for updates? Did you update the modules directory to 2.0.1? It looks like it still shows 1.1.3 for some reason?