Convert file path to custom element