-
Notifications
You must be signed in to change notification settings - Fork 8
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
Making regions more usable. #11
Comments
I went ahead and did this an added |
Hey @tmeasday! Sorry for the delay. I'm trying to understand the idea but not sure I'm getting it. So, in the first example, are you trying to set the content for the 'title' region by passing its value as an argument to Layout? Where does title's value from from? Is it dynamic? Why go through the trouble of creating a yield region in this case vs. just putting some dynamic content in the layout. What am I missing :)? |
Hey @cmather. I'll try to be clearer about the base use case and then perhaps my comments above will make more sense. We're using layouts to wrap the contents of a template in standard boilerplate. As an example, the title of the page is included in the boilerplate. For some pages, the title is fixed -- for others it's dynamic. I was talking about a case where the title is dynamic, and thus a helper on the outer template ( With the current API, we could just do:
But I'm looking for a way to set the content or template (both are important) for a region more directly when calling |
I realise you probably haven't had time to think about this, but when you can circle back round I have a quick qn in regards to this: If I render a layout with helper argument (like It doesn't seem like |
Might be a limitation if I recall. I Need to check though.
|
Howdy @cmather
So I'm working on converting Verso over to BL and it makes heavy use of layouts. One thing that we used to do with our old janky layouts system was bind helpers to regions. So something like
So essentially we are passing the content for a region in via the arguments to
{{#Layout
.What do you think?
Related ideas:
titleTemplate='foo'
perhaps?title=title
and just automatically search for a helper namedtitle
when trying to{{> yield region='title'}}
if no content is set for that region.Happy to implement whatever (actually I'll probably implement the first thing right now in a branch) if you agree on the API..
The text was updated successfully, but these errors were encountered: