Closed kflorence closed 9 years ago
I could see a case for this, but I have some reservations. Primarily, it changes the assumptions about how the plugin works, namely it makes {{#extend}}
and {{#embed}}
act like a {{#content}}
block, even though they currently serve very different purposes.
If I were to implement this, I think I'd simplify the use to something like this:
<!-- layout.hbs -->
<div>{{#block}}{{/block}}</div>
<!-- page.hbs -->
{{#extend "layout"}}
content goes here
{{/extend}}
But that brings up another case where someone might expect this to also work:
<!-- page.hbs -->
{{#extend "someOtherLayout"}}
content goes here
{{#content "header"}}
and more goes here
{{/content}}
{{#content "footer"}}
and a little goes here too
{{/content}}
{{/extend}}
Right now, I think this complicates things more than it helps. I'll leave this issue open for a while longer to see if anyone else chimes in, but as it stands, I'm not inclined to implement this.
Closing for now. Again, if there's more demand for it, I'm willing to revisit.
It would be nice if there were defaults for simple use cases, for example when a layout has only one block.
Take the following example:
Layout:
Page:
I could instead write something shorter, like:
Or:
Where
{{content}}
without a name defaults to some value, like "content". This same syntax should also be available for embeds.