We explore various reticular porous materials, such as metal-organic and covalent organic frameworks and polyhedra as molecular templates for formation of confined atomically defined solid-state structures within the pores by incorporation of main group metal halide (MH) compounds. MH materials are known to exhibit exceptional luminescence and other optoelectronic properties. Single crystals of the porous materials can be employed as molecular templates for crystallizing MHs within the cavities. In this way, geometry, functionality, electric charge and topology of the pores determines the structure of resulting metal halide units, what might enable rational synthesis of desired solids and gives access to structures which are not known to form otherwise, and thus further tailoring optoelectronic properties. Our current work focuses on explorations of various frameworks and polyhedra and MHs as hosts and guests, respectively, offering vast compositional and structural space to dive in.