Porous and phase change nanomaterials for photonic applications