Closed carolinebeltran closed 5 years ago
Hello and thank you for such a nice library. Is there some way to include (or embed) one template into another template? For example:
{{header}} {{EMBEDDED_TEMPLATE}} {{footer}}
data.emplace("header", "Hello World!"); data.emplace("EMBEDDED_TEMPLATE", "{{header}} - {{footer}}"); data.emplace("footer", "Goodbye World!");
Hello World! {{EMBEDDED_TEMPLATE}} Goodbye World!
Hello World! Hello World! - Goodbye World! Goodbye World!
I think Partials is what you're looking for, see this example.
That was it Jamboree, thank you!
Hello and thank you for such a nice library. Is there some way to include (or embed) one template into another template? For example:
{{header}} {{EMBEDDED_TEMPLATE}} {{footer}}
data.emplace("header", "Hello World!"); data.emplace("EMBEDDED_TEMPLATE", "{{header}} - {{footer}}"); data.emplace("footer", "Goodbye World!");
Actual output:
Hello World! {{EMBEDDED_TEMPLATE}} Goodbye World!
Desired output:
Hello World! Hello World! - Goodbye World! Goodbye World!