-
Notifications
You must be signed in to change notification settings - Fork 405
Pattern parameters not working in conjunction with style modifiers. #606
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
Comments
Same problem with |
Just found out that additional styleModifiers (2nd and next) must not contain dash ( Also watch out for parentheses in parameter values - seems that Pattern Lab doesn't like it either. |
quite similar problem here
no pattern parameter is applied. my problem come from the multiple styleModifiers, because if let only one styleModifier, the pattern parameter is included properly
|
I'm not sure if this is the exact same issue, but it's close enough I think. I'm including a pattern into a template and attaching a pattern parameter, like so:
In my page JSON file, I'm then adjusting the number of items in my slider, like so:
Unfortunately the data changes I'm defining in JSON aren't being applied when the pattern parameter is in place. If I remove the pattern parameter, the JSON data gets applied properly. The expected behavior would be to have both the pattern parameters and JSON data work in conjunction with one another. |
@bradfrost if you could give me a as best you can reduced reproduction of the issue - I'll get on it |
can you confirm the presence of the hyphen is what causes the problem? if so, it might be a simple regex issue |
@bmuenzenmeyer hmm, I changed it to |
@bradfrost yes thanks for checking. if you can provide as much of your pattern templates starting at (you can send this to me privately if you like too.) |
I have a similar issue
paragraph-block-isolate.twig paragraph-block.json
paragraph-block~isolate.json
This is working when I look at the pattern at the molecule level however, as soon as I include the pattern at in a template or a page I get no data coming through even if I include a json file in the template or page folder. template.twig
|
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. |
@Roralee I'm not as in the weeds as @bmuenzenmeyer is, but we're in the process of deprecating pattern parameters and style modifiers in favor of moving to Handlebars' way of dealing with passing data into partials. Pattern parameters and style modifiers were customizations added to Mustache, and the strategy is to remove the custom pattern parameters syntax and rely on templating engines' built-in ways of passing in parameters. What can you do in the meantime? You can accomplish passing the data in through JSON or YAML like so:
Or you can switch to the Handlebars templating engine to accomplish that in a way that's built into the templating engine:
|
Thanks for the callout, the tease, and the workaround @bradfrost I agree with all of what you said, but wanted to add that it's very much my plan to support Mustache as part of the 3.X release cycle - and I think I fixed most of this stuff with a 3.X alpha. That being said, any moderate to heavy use of Pattern Parameters and StyleModifiers should make one pause and question if Mustache is the right tool to use - hence Handlebars. see also #834 |
Hi, can the docs get an update for this. Took me a while to figure in the hbs files to use not :string() but string=“” |
I am using Pattern Lab Node
vv2.7.2
onMac
, with Nodev7.5.0
(behaviour also seen onv6
), using theGulp
Edition.I have an atom
And I'm calling it in a molecule template like so
{{> atoms-button-primary:pull-sm-left|course-mini-quiz__back-button|ng-hide(btnNgClick: "back()", btnText: "Back") }}
But the resulting HTML in PL is
Nothing is getting replaced, apart from
btnText
which is coming fromdata.json
.If I remove the patter parameters then the style modifiers come through ok.
{{> atoms-button-primary:pull-sm-left|course-mini-quiz__back-button|ng-hide }}
I see a lot of parameter issues in Github, but nothing that exactly matches this fairly simple case, I'm not nesting multiple levels or using any unquoted strings.
Happy to get stuck in to help debug this, or have it pointed out that I'm doing something exceedingly stupid 😉
The text was updated successfully, but these errors were encountered: