-
Notifications
You must be signed in to change notification settings - Fork 405
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
Allow data.json inheritance at pattern group level #599
Comments
As you point out, there could be an (admittedly unlikely) naming clash if someone happens to have a pattern called data. To avoid that, how about having the category-specific JSON file one level up like this:
This approach sort of mimics how per-pattern JSON files live next to the Mustache files they relate to, in that it puts the per-category JSON files next to the folder they relate to. |
To me, this is the sort of thing that, if we were to support it, we should build it correctly across platforms, or at least get it voted across both. |
You mean for both PHP and Node? |
correct. I understand the utility, but wish to adhere to the conventions Dave and I put in place for making significant changes to the core experience. https://github.com/pattern-lab/the-spec is the right place to debate this, in my opinion |
@james-nash Maybe it would be a good idea to simply mimic the structure of |
worth noting, this is how markdown works too for sub-categories |
Seems sensible. FWIW, an additional scenario where this is useful is the pages category, if you're (strictly?) following Atomic Design. For atoms, molecules, organisms and templates you might want to use lorem ipsum text and wireframe-like boxes as image placeholders - that's easily done via the root This would be a more elegant solution IMHO since you'd override what you need to once, at the category level. |
@bmuenzenmeyer @tburny Happy to raise an issue for this over on the spec project, unless one of you is already doing that |
Go for it 👍 |
@bmuenzenmeyer Am I allowed to? It looks like all spec issues so far came from Dave Olsen or yourself. Don't want to be treading on anyone's toes :-) |
others are encouraged. only him or I may call a vote on the topic once we've figured out the details. |
Ok cool. Doing it now. |
@bmuenzenmeyer Done: pattern-lab/the-spec#31 I wasn't sure what to put for the timeline and tagging stuff at the bottom, so I've commented those bits out for now. Feel free to edit as you see fit (or tell me what to put in there). |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
I am using Pattern Lab Node
v2.7.1
onLinux
, with Nodev4.6.2
, using theGrunt
Edition.Expected Behavior
Especially for patterns in the
pages
category it should be possible to override the globaldata.json
with category-specific values. Pattern data can still override the data, so the chain should be_data/data.json
→_source/patterns/pages/data.json
→_source/patterns/pages/my-page.json
where → means overridden by.A use case is that there might be homepages with different brands. For instance there are (München Ticket) (http://muenchenticket.de) and Sueddeutsche Tickets (SZ) which share the same layout, but brands should be interchangable in the PL based on the
data.json
.The advantage is that for SZ pages the JSON doesn't have to be defined for each and every SZ page.
Actual Behavior
Placing a
data.json
in a subfolder ofpatterns
has no effect (unless there is a pattern nameddata.html
of course).The text was updated successfully, but these errors were encountered: