-
Notifications
You must be signed in to change notification settings - Fork 406
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
PL does not support twig extends #554
Comments
I have the same issue. Any progress on this? For me it looks like extends acts like include. |
Unfortunately, I doubt it/ Our initial contributor to the Twig engine has not been seen in a while Cross - linking to #285 |
Has anyone found a workaround for this? Maybe with Nunjucks? I wish I could fix it but my JS and PHP chops aren't there yet. 😕 |
I looked into it quickly. So we have to use templates file path in order to render them. @bmuenzenmeyer : finally it only require for the object param passed to the renderPattern method to give us the root template path (the user's |
@gael-boyenval, thanks for the quick response! I played around with Nunjucks for a while last night, but I keep getting an error with it so I'm stuck. I'll report back if I get it working. |
@gael-boyenval thanks for the sluething and the direction - I can see what I can do :) |
@KatieMFritz : nunjucks is another template engine. If you want it to work you'll have to develop a pattern-engine, a pattern-lab specific component on top of nunjucks. |
I spent too long trying to get this to work tonight. No combination of the below seemed to work: renderPattern: function renderPattern(pattern, data) {
var result = twig({
allowInlineIncludes: true,
path: path.relative(__dirname, path.resolve(process.cwd(), 'source', '_patterns', pattern.relPath)
//data: pattern.template
}).render(data);
return result;
}, cannot call render() on undefined. |
@bmuenzenmeyer if you wanted to assign this one to me I can take a crack at this this week |
gopher it! |
@bmuenzenmeyer taking another look at this now! |
I'm working on a Nunjucks engine that's nearly complete. I resolved this issue by...
May not be the best solution, but something that's working for now. |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
This is supported in package https://github.com/pattern-lab/patternlab-node/blob/dev/CHANGELOG.md#580-2020-04-03 |
I am using Pattern Lab Node
v2.6.1
onMac
, with Nodev6.7
, using theGulp
Edition.Expected Behavior
when extending a template, it extend the template…
it is referenced here too : #285
Actual Behavior
when extending, pl make it like including
Steps to Reproduce
x.twig
=> output
foobar
y.twig
=> output
foobar
to=> should output
foobaz
z.twig
=> output
foobarbar
=> should output
foobarbaz
The text was updated successfully, but these errors were encountered: