One way to successfully enhance light harvesting of excitonic solar cells is the integration of optical elements that increase the photon path length in the light absorbing layer. Device architectures which incorporate structural order in form of one- or three-dimensional refractive index lattices can lead to the localization of light in specific parts of the spectrum, while retaining the cell's transparency in others. Herein, we present two routes for the integration of photonic crystals (PCs) into dye-sensitized solar cells (DSCs). In both cases, the self-assembly of soft matter plays a key role in the fabrication process of the TiO2 electrode. One approach relies on a combination of colloidal self-assembly and the self-assembly of block copolymers, resulting in a double layer dye-sensitized solar cell with increased light absorption from the 3D PC element. An alternative route is based on the fact that the refractive index of the mesoporous layer can be finely tuned by the interplay between block copolymer self-assembly and hydrolytic TiO2 sol-gel chemistry. Alternating deposition of high and low refractive index layers enables the integration of a 1D PC into a DSC.