Layered organic–inorganic hybrid perovskites: structure, optical properties, film preparation, patterning and templating engineering | Synapse