substitute ##STATIC## in templates