Template-controlled topochemical photodimerization based on "organometallic macrocycles" through single-crystal to single-crystal transformation.