Anisotropic confinement of chromophores induces second-order nonlinear optics in a nanoporous photonic metamaterial.