The fingerprints of photoionization and shock-ionization in two CSS sources