Conversation around being able to reference a parent partial came up. This level of inversion is very handy for Express development. Consider the following outside of Express:
It is quite easy to see how composition can work going down from the layout referencing the partial. What isn't clear is how to go in the opposite direction:
var layout = combyne("<body>{%partial content%}</body>");
var content = combyne("hello world");
content.registerPartial("layout", layout);
There's no way here for the child to know how to inject itself into the layout. This is frustrating for pages in Express that would like to be contextual to the given route:
app.get("/about", function(req, res) {
// Wants to be injected into the main page layout.
res.render("about");
});
One way of handling this is an inject/yield style expression being added:
{%render layout as content%}
hello world
{%endrender%}
This would allow referencing a previously defined partial and injecting into it's own defined partial region.
An alternative syntax is also being considered, named yield:
{%yield into "layout" as "content"%}
hello world
{%endyield%}
Possibly render?
{%render layout as content%}
hello world
{%endrender%}
Conversation around being able to reference a parent partial came up. This level of inversion is very handy for Express development. Consider the following outside of Express:
It is quite easy to see how composition can work going down from the layout referencing the partial. What isn't clear is how to go in the opposite direction:
There's no way here for the child to know how to inject itself into the layout. This is frustrating for pages in Express that would like to be contextual to the given route:
One way of handling this is an inject/yield style expression being added:
This would allow referencing a previously defined partial and injecting into it's own defined partial region.
An alternative syntax is also being considered, named yield:
Possibly render?