Skip to content
This repository has been archived by the owner on May 5, 2021. It is now read-only.

Lists not working in Material Front-matter #269

Open
andypillip opened this issue Jun 16, 2016 · 5 comments
Open

Lists not working in Material Front-matter #269

andypillip opened this issue Jun 16, 2016 · 5 comments
Milestone

Comments

@andypillip
Copy link

andypillip commented Jun 16, 2016

In my navigation-component I'm trying to define navigation items:


---
navItems:
  - Bootcamp
  - Personal Training
  - Fit Mom
  - Stundenplan
  - Über mich und mein Training
  - Kontakt

---

But {{#each navItems}} in the same component does not work.

When I move the list declaration to toolkit.yml, and use {{#each toolkit.navItems }}, it works.

@andypillip
Copy link
Author

Also the form

navItems: [Bootcamp, Personal Training, Fit Mom,…]

doesn't work.

@LukeAskew
Copy link
Member

Try removing the space between the # and each: {{#each navItems}}

@andypillip
Copy link
Author

andypillip commented Jun 16, 2016

@LukeAskew sorry that was a typo in my issue. I didn't have a space in my toolkit.

Otherwise it wouldn't have worked with the toolkit.navItems either.

@nrambeck
Copy link

Some problem here. I've had to reference the local variable with the global based on the pattern name:

If my pattern is widget.hbs then I can only access the local front-matter data arrays with the each help like so:

{{#each widget.navItems}}

@karlschwaier
Copy link

karlschwaier commented Jul 21, 2016

I also struggled with this problem. {{#each widget.navItems}} works just as long as you are not moving widget.hbs into a sub folder like materials/components/widgets/widget.hbs.
{{#each widgets.widget.navItems}} doesn't work either.

Is this a bug or do I understand something wrong?

@LukeAskew LukeAskew added this to the 2.0.0 milestone Apr 6, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants