-
Notifications
You must be signed in to change notification settings - Fork 32
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
include TwigException #49
Comments
So, after many tests, it appears that the problem is due to hyphens in the file name. Is it possible to fix this in the plugin? |
Experiencing the same issue with a nested include, where I'm including a partial in a partial. It compiles, but I get an exception that it's unable to find the template file. My file also has hyphens in the filename. |
Oops look like this ticket slipped through the cracks. @jameelmoses for you is there no error if the file name doesn't have hyphens? |
I can check in the morning and report back |
So it looks like this issue for me is actually related to kss-node not being able to locate the nested include and not an issue with gulp-twig |
@jameelmoses Did you manage to get nested includes working? When it tries to compile the following twig code I get the error TwigException: include function does not exist and is not defined in the context. I'm trying to pass an include as data to the card.twig component. {% include 'components/card.twig' with {
title: "My Title",
actions: [
include('components/button', {
text: "Click Me"
}, false)
]
} only %} |
yes, my issue was with kss-node and needing to use relative paths for nested includes. i've never attempted an implementation the way you're doing so can't really speak to it, but i will says when I am passing variable includes into a template, the best way is to use example:
alternatively, if you always just have an optional button, you should just be able to do this also:
|
First of all, thank you for your plugin, I use it a lot :)
I've tryed to update from 0.5.0 to the latest version but when I run the task (which worked fine with 0.5.0) it returns a lot of twigexception like this one:
Task:
Nevertheless, templates are compiled.
Did I miss something?
The text was updated successfully, but these errors were encountered: