Open
Conversation
Contributor
Author
|
We've also discussed both the helper and the data issue being solved by more flexibility in Blaze. I can probably live with waiting for that, but we should definitely keep this PR around until we get an alternative. If you are attached to contentFor (probably, I personally don't use it ATM), and can't think of another way to make it work (hopefully you can!), don't spend too long looking at this for now. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Hey Chris,
This branch solves the problems I've seen with helpers + data not correct passing through to the content block of a Layout when used outside of IR.
It's quite a simple change really -- we remove the hacks that pass helper lookups through the Layout Component, and instead us the
UI.InTemplateScopethat already exists in Blaze.What this does behind the scenes is wires the
__contentblock up with theLayoutcomponent's parent as it's parent. Apparently this is OK, as this is exactly what happens when you use a template as a layout via a block helper inclusion +{{> UI.contentBlock}}.There's only one downside to all this, and it might be a deal-breaker. I'm keen to hear you thoughts.
The problem is that because the content block is now short-circuited around the
Layout, there doesn't appear to be any way to getcontentForto work. That's because it looks like this:Any ideas how to work around this? Otherwise, it seems like an ideal way to make helpers and data work in a rational, sensible way inside yielded regions.