Conformational switching by the scaffolding protein D directs the assembly of bacteriophage phiX174.