public static function renderThemeTemplate($target, $templateId, $data = array()){

        //search in the registry to get the custom template to render
        $tpl = self::getThemeTemplate($target, $templateId);
        $theme = self::getCurrentTheme();

        if(!is_null($tpl)){
            if ($theme instanceof ConfigurablePlatformTheme) {
                // allow to use the getters from ConfigurablePlatformTheme
                // to insert logo and such
                $data['themeObj'] = $theme;
            }
            //render the template
            $renderer = new \Renderer($tpl, $data);
            return $renderer->render();
        }
        return '';
    }