-
Notifications
You must be signed in to change notification settings - Fork 407
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
Consider support for pattern links inside base data object #171
Comments
@bmuenzenmeyer @dmolsen Let's see if I can explain this adequately. When I wrap something in a name, it's to make a specific instance of that pattern that I can swap out the data. For example, I might have a homepage with a hero unit:
Further down the page, I may have a secondary hero:
In my
By baking the context into the pattern like |
Wouldn't the href inside
|
Yep exactly. The |
Did this get answered for you? FWIW, this is a pretty simple, brute force feature. Looks more complicated than it probably needs to be because of scope, getters and setters. |
Hey @dmolsen yes this makes sense to me now. I've spent a lot of brain cycles on it - dunno what's wrong with me. How I understand it... With a file that contains:
where
Pattern Lab Node expands everything first to...
and then renders the partial with the data as Brad mentioned.
The output will be
After which the existing link logic should pick this up. I realize now I was confusing mustache conditional blocks with the nested data retrieval syntax. |
FWIW, that's not quite how PL PHP tackles this problem. I think the output you have will end up with an error for the end-user as the front-end of PL doesn't do anything with, for example, After snarfing in all of the patterns and their associated data the entire data structure is parsed for values of As I noted earlier, it's a bit brute force but it seems to work. |
Right, I was a bit terse at the end with the previous explanation. I've had working template code like 01-molecules/05-navigation/00-primary-nav.mustache in patternlab node for while that does the preprocessing prior to surfacing to the UI:
So there definitely is some disconnect between all this, like the missing |
I've got it reproducing the exact behavior Dave reports - 🔮 Now to fix! |
bugfix: #171 pattern links inside base data object
Need to further investigate pattern links in data... per this issue, which points ultimately to this patternlab php issue
I'm confused by this syntax:
working with
Shouldn't it be the following, to let the natural mustache processing take over?
🆘 @dmolsen or @bradfrost you both have experience using this in PL-PHP - some guidance would be appreciated.
The text was updated successfully, but these errors were encountered: