connect template with post