template scopes (foreach)