Controlling collective electronic states in cuprates and nickelates : a resonant X-ray scattering study (2020)