The conversion of an amorphous, non-porous polymer network into an ordered, microporous covalent organic framework under ionothermal conditions is presented. The amorphous polymer network is prepared by trimerization of carbonitrile monomers using strong Broensted acids. In a second step the polymer network is converted into a porous covalent triazine framework (CTF) under ionothermal conditions, i.e. in molten zinc chloride. This two-step process largely facilitates the synthesis of CTFs as the application of a polymeric precursor avoids early evaporation of small organic compounds at the high temperatures of the ionothermal process and therefore no evacuated and sealed quartz ampoules have to be used, which makes the CTF synthesis easier, safer and scalable.