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.InTemplateScope
that already exists in Blaze.What this does behind the scenes is wires the
__content
block up with theLayout
component'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 getcontentFor
to 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.