patternlab-php
patternlab-php copied to clipboard
Data Override Not Working As Expected
I am using Pattern Lab PHP on Mac, using Grunt.
Created a new PL2 Project. Added atoms-/button
and molecules-button-list
to the project.
atoms/button
markup:
<button class="button">
<span class="button__text">
{{# buttonText }}
{{ buttonText }}
{{/ buttonText }}
</span>
</button>
I have the molecules/button-list
marked up as:
<ul class="button-list">
{{# buttonList }}
<li class="button-list__item">{{> atoms-button }}</li>
{{/ buttonList }}
</ul>
In data.json
I have:
"buttonList" : [
{},
{},
{},
{},
{},
{},
{},
{},
{},
{},
{},
{}
]
In my button-test
page's JSON button-test.json
, I have:
"buttonList" : [
{
"buttonText" : "Test1"
},
{
"buttonText" : "Test2"
}
]
Expected Behavior
Removed buttonList
altogether from data.json and defined it only in button-test.json
to get this:
Actual Behavior
Page-based JSON overrides the first 2 items in data.json
but prints out the rest of the items from buttonList
According to Brad, it seems like a regression bug of some sort.
This might actually also be the same issue I have been experiencing on Mac with the Twig engine. List item data just does not work and I logged the issue in the Twig pattern engine.
https://github.com/pattern-lab/patternengine-php-twig/issues/30