Dynamic Macro Calls

64 views
Skip to first unread message

Andres Aguiar

unread,
Jun 24, 2015, 8:18:56 AM6/24/15
to nunj...@googlegroups.com
Hi,

I want to call a different macro depending on the value of a variable. I have are a large number of possible macros and I want to be able to easily add new ones, so having an 'if' is not a good solution.

I found that in jinja2 you can do it with a filter http://stackoverflow.com/questions/14016356/jinja2-macro-selecting-macro-or-dynamic-macro-calls. I couldn't find a way to do the same in nunjucks.

Any pointers?

Thanks a lot


Reply all
Reply to author
Forward
0 new messages