An organic template of polystyrene colloidal crystals was fabricated through dip-coating in a polystyrene emulsion. Based on the template, an ordered porous TiO 2 film doped with Gd 3+ was deposited on a conductive glass. x-ray diffractometry (XRD), scanning electron microscopy (SEM), UV-vis spectroscopy were used to characterize the structures and properties of the film. The as-produced film was used as an electrode in dye-sensitized solar cells with a sandwich structure. XRD showed that anatase TiO 2 was obtained. SEM images clearly demonstrated that these films had an ordered porous structure, mainly in a hexagonal orientation. UV-vis spectroscopy revealed that the absorption was improved in both the ultraviolet and the visible areas. Under simulated solar illumination, a short circuit current of 0.618 mA and an open circuit voltage of 0.538 V were attained, which were better than the performances of only a TiO 2 film electrode and an ordered porous TiO 2 film electrode.