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

Conditional Statement from meta/foot.mustache isn't loaded #410

Closed
sergejreznik opened this issue Jul 28, 2016 · 2 comments
Closed

Conditional Statement from meta/foot.mustache isn't loaded #410

sergejreznik opened this issue Jul 28, 2016 · 2 comments

Comments

@sergejreznik
Copy link

sergejreznik commented Jul 28, 2016

I am using Pattern Lab Node v1.2.3 on Mac, with Node v4.4.7, using the Gulp Edition.

I've got a problem with showing special content on a special page with a type of conditional statement.

For example:

My data.json looks like this:
bildschirmfoto 2016-07-28 um 10 21 03

My _meta/_01-foot.mustache - which is loaded on every page - looks like this:
bildschirmfoto 2016-07-28 um 10 19 52

Then I've got a Page Pattern called02-index-scroll.mustache and a 02-index-scroll.json that looks like:
bildschirmfoto 2016-07-28 um 10 19 58

In this demo case the <span class="test">foo 1</span> should be visible on one specific Page, where the json key is set to true.

My rendered DOM looks like this:
bildschirmfoto 2016-07-28 um 10 26 26

The span inside of the "if-statement" is not rendered on the page.

EDIT: I see, it's working if I create a new foot.mustache inside of the _patterns folder and include it to the page . But this way it's not dynamically anymore and the JS is loaded in a incorrect way. Or I have to load the JS-Files twice.

EDIT(2): the same conditional statements works inside the _meta/_00-head.mustache.
Tried to include a css-file only on the specific page. Works fine. So whats the problem with the _meta/_01-foot.mustache? In real I want to include specific JS.

Thank you.

@bmuenzenmeyer
Copy link
Member

I believe this is related to pattern-lab/the-spec#24 which is not yet implemented in Node

i will bump it in priority

@sergejreznik
Copy link
Author

It's not about including pattern but including conditional statements to load specific libraries on specific pages for example. But including patterns in these files would also be great.

Thanks.

@bmuenzenmeyer bmuenzenmeyer modified the milestone: 2.5.0 Aug 15, 2016
@bmuenzenmeyer bmuenzenmeyer self-assigned this Aug 27, 2016
bmuenzenmeyer added a commit that referenced this issue Aug 27, 2016
@bmuenzenmeyer bmuenzenmeyer removed their assignment Aug 30, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants