General developer forum

Overriding a mod renderer in a Boost child theme

 
Picture of Pierre Duverneix
Overriding a mod renderer in a Boost child theme
 

Hi,

I'd like to override the mod_lesson renderer in my custom Boost's child theme. So far, I already have overriden some core_renderer functions but I have trouble registering mod renderers.

I tried the following class inside theme_mytheme/classes/output/mod_lesson/custom_renderer_cli.php :

namespace theme_mytheme\output\mod_lesson\custom_renderer_cli;

defined('MOODLE_INTERNAL') || die;

class theme_mytheme_mod_lesson_renderer extends mod_lesson\renderer {

    public function progress_bar(lesson $lesson) {

        // ...

    }

}

This doesn't have any effet... What am I doing wrong ?

 
Average of ratings: -
Picture of Pierre Duverneix
Re: Overriding a mod renderer in a Boost child theme
 

Ok, it seems to be working with the following :

defined('MOODLE_INTERNAL') || die;

class theme_gaco_mod_lesson_renderer extends mod_lesson_renderer {

    public function progress_bar(lesson $lesson) {

        // ...

    }

}

 
Average of ratings: Useful (1)
Picture of Jorge Mariano Paz Flores
Re: Overriding a mod renderer in a Boost child theme
 

Hello Pierre,


How did you override core render?

I want to override the full_header method, but I can't make it work

 
Average of ratings: -