Open iredmail opened 3 years ago
Let's say we have a macro like this:
{% macro greetings(to, from=name, name2="guest") %} ... {% endmacro %}
Currently we can only call it like this (copied from template_tests/macro.tpl):
template_tests/macro.tpl
{{ greetings() }} {{ greetings(10) }} {{ greetings("john") }} {{ greetings("john", "michelle") }} {{ greetings("john", "michelle", "johann") }}
It should be more useful to call it with argument names, especially when the macro has more arguments:
{{ greetings(to="john") }} {{ greetings("john", from="michelle") }} {{ greetings("john", name2="michelle", from="johann") }}
We try to organize some reusable HTML/CSS code lines to a macro, and it accepts multiple arguments. But currently the macro is not suitable for this task because hard to remember all arguments while calling the macro.
Hello @flosch, is there any update on this? Or can you point me in the right direction to start working on this?
Let's say we have a macro like this:
Currently we can only call it like this (copied from
template_tests/macro.tpl
):It should be more useful to call it with argument names, especially when the macro has more arguments:
We try to organize some reusable HTML/CSS code lines to a macro, and it accepts multiple arguments. But currently the macro is not suitable for this task because hard to remember all arguments while calling the macro.