Fix template conditional to include a serialize method instead of directly rendering the template.