pattern-lab / edition-node-gulp

ARCHIVED - The gulp wrapper around patternlab-node core, providing tasks to interact with the core library and move supporting frontend assets.
MIT License
279 stars 111 forks source link

Link not working with pattern parameters in action #102

Closed bradfrost closed 7 years ago

bradfrost commented 7 years ago
Expected Behavior

Using link in JSON, such as:

{
    "url": "link.pages-homepage"
}

Should render links correctly when pattern parameters are in place, such as:

{{> organisms-header(styleModifier: "c-header--vertical") }}
Actual Behavior

The {{ url }} field is replaced with link.pages-homepage, resulting in a link that looks like <a href="link.pages-homepage">. This returns a 404 page when clicked.

Steps to Reproduce
  1. Create a link to another Pattern Lab page in JSON.
  2. Include a component that includes the desired link while passing in pattern parameters.
  3. Click the link
bmuenzenmeyer commented 7 years ago

in an unlikely workaround scenario, does

{{> organisms-header:c-header--vertical }}

work instead?

(pattern parametes are buggy - i wonder if using only the stylemodier syntax would work) http://patternlab.io/docs/pattern-stylemodifier.html

frostyweather commented 7 years ago

@bmuenzenmeyer That seemed to do the trick workaround wise.

Since we were naming the styleModifier headerStyleModifier, we used a different workaround that wrapped the header in {{# styleguideHeader }}{{/ styleGuideHeader }} and used the JSON file to change the modifier:

"styleguideHeader" : {
        "headerStyleModifier" : "c-header--vertical"
 }
bmuenzenmeyer commented 7 years ago

good. sorry for the inconvenience. after some client work finishes up i plan to re-focus again more on issues such as these.

as we've always maintained.... the more you use pattern parameters, the more trouble you get into 😱

frostyweather commented 7 years ago

@bmuenzenmeyer No worries, just glad there's a workaround for now. Thanks!

bmuenzenmeyer commented 7 years ago

I've fixed this, and perhaps found the source of many other bugs due to an order of operations problem with core. Look for an official release soon.

bmuenzenmeyer commented 7 years ago

@bradfrost @frostyweather this is fixed with https://github.com/pattern-lab/patternlab-node/releases/tag/v2.9.2

npm update