Functional materials derived from open framework templates/precursors: synthesis and applications