Make template layout depend on the accept format