-
Notifications
You must be signed in to change notification settings - Fork 16
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
Faker doesn't work in Pattern Data Files, but does in global data #2
Comments
I wasn't able to get it working either. Very strange. Luckily, I was able to get the Don't run the composer command. Just make the faker.function.php file. Then, in my Twig file, I call |
That's a great workaround! I'll probably end up using that where needed; thanks so much! I've got a lot of Faker data in my global data.json file for vars used in lots of places that are really helpful: https://github.com/phase2/pattern-lab-starter/blob/master/source/_data/data.json |
Awesome! Thanks for showing me (us?). I'm only just getting back into this (too many months on print projects), but I'm also glad they're building Faker into patternlab. Cheers! |
The workarounds go a long way, but it would be ideal if we could just get faker working in pattern-specific data files. @dmolsen, any plans to support that or thoughts on how best to approach it? I know there are plugins out there that support that kind of per-pattern data replacement (e.g. data-transform). I'm curious whether you considered a similar approach and decided against it or just haven't had a chance to try it. |
…ke pattern-specific data
The provided PR #7 worked for me. Please consider a merge. |
I'm only able to get Faker to work in the global data file, and not in the pattern specific data files. So I've got something like this in
source/_data/data.json
:"name": "Faker.firstName"
and it works, but not inauthors.json
when next toauthors.twig
.This is a super helpful plugin, thanks!!!
The text was updated successfully, but these errors were encountered: