Skip to content
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

List Items JSON not pulling through #30

Open
magnition-ci opened this issue Sep 12, 2016 · 1 comment
Open

List Items JSON not pulling through #30

magnition-ci opened this issue Sep 12, 2016 · 1 comment

Comments

@magnition-ci
Copy link

I've been having issues with using any custom list items in loops within the PHP and Twig Patternlab. So far I have tried adding the JSON content both within the Pattern partials folders and also within the data folder but neither seem to be picked up within my templates and I get empty arrays rendering. I only seem to be able to use the standard data setup within the listitems.json in the data folder but even when I try to add new data to that file it still does not pick up. Is there something I am missing or is this possibly a bug?

JSON Data
{ "1" : { "coreplans" : { "id" : "silver", "plantitle" : "Silver", "summary" : "Some description text here for the silver level", "atoms-ticked" : { "one": "List item one", "two": "List item two", "three": "List item three", "four": "List item four" } } }, "2" : { "coreplans" : { "id" : "gold", "plantitle" : "Gold", "summary" : "Some description text here for the gold level", "atoms-ticked" : { "one": "List item one", "two": "List item two", "three": "List item three", "four": "List item four" } } }, "3" : { "coreplans" : { "id" : "platinum", "plantitle" : "Platinum", "summary" : "Some description text here for the platinum level", "atoms-ticked" : { "one": "List item one", "two": "List item two", "three": "List item three", "four": "List item four" } } } }

Twig loop within the template
{% for item in 1..3 %} <div class="col-sm-4"> {% include "molecules-block-plan" %} </div> {% endfor %}

Molecule block example
`


{% include "atoms-label-small" %}


{% include "atoms-h3" %}


{% include "atoms-paragraph" %}
{% include "atoms-ticked-plans" %}
Explore all {{ coreplans.plantitle }} benefits
{% include "atoms-button" %}

`
@MacKP
Copy link

MacKP commented Oct 19, 2016

I have the same issue with the mustache Version of Patternlab.
Maybe it's not planned to use more listitem-Files in the _data Folder.

regards

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants