I have 2 stencil templates, which pretty much the same except the variable name is different:
template #1
{% for p in anArray %}
{% if p.property1 = "abc" %}
// some logic
{% endif %}
{% endfor %}
template #2
{% for a in aDifferentNameArray %}
{% if a.property1 = "abc" %}
// same logic as template 1
{% endif %}
{% endfor %}
I think it will be cleaner if I can refactor this into a template and have template #1 and #2 call this new template
{% if ??.property1 = "abc" %}
// same logic as template 1
{% endif %}
But problem is in template #1, the variable is p
where as in template #2, the variable is a
.
So what can i do to call the new template with template #1 & #2 with different variable name?