For one of my sentences, a native German speaker corrected it to be a “dative + sein” construction.
Original: Wenn es nur wahr wäre.
Suggestion: Wenn dem nur so wäre!
They proposed that the suggested structure was more elegant and gave a second example:
Original: Das war nicht aber so.
Suggestion: Dem war nicht aber so.
Can someone please tell me what the underlying grammar rule is for the “dative + sein” structure and whether it applies to other combinations?