[NGRINDER-697]Use freemarker macro to make ftl more concise

Synch with master branch