1,2-Bis(4-pyridyl)ethylene undergoes a photoinitiated [2+2] cross-cycloaddition reaction with allyl groups of allylmalonate in pores of a 3D metal-organic framework (MOF) [Zn2(H2O)2(Amal)2(bpe)] to produce a 3D MOF with a new topology.