We present a simple two-dimensional model in which the lattice degrees of freedom mediate the interactions between magnetic moments and electric dipoles. This model reproduces basic features, such as a sudden electric polarization switch-off when a magnetic field is applied and the ubiquitous dimerized distortion patterns and magnetic ↑↑↓↓ ordering, observed in several multiferroic materials of different composition. The list includes E-type manganites, RMnO3, nickelates such as in YNiO3 and other materials under strain, such as TbMnO3. In spite of its simplicity, the model presented here captures the essence of the origin of multiferroicity in a large class of type II multiferroics.