Stereoselective syntheses via a photochemical template effect