Hi,
I would like to add an image as a logo in my code.
I would like to override the variable $logo, and linked to an image that I have in the pix folder of my theme. ('http://localhost:8000/theme/javier/pix/i/logocompact.png').
I've added this to theme/{theme_name}/renderers.php but it doesn't work.
I have already modified other functions on my thema, but I can't get this one to work.
Any ideas?
Find my code below:
class theme_javier_renderer_base extends renderer_base {
public function get_compact_logo_url($maxwidth = 300, $maxheight = 300) {
global $CFG;
$logo = 'http://localhost:8000/theme/javier/pix/i/logocompact.png';
if (empty($logo)) {
return false;
}
// Hide the requested size in the file path.
$filepath = ((int) $maxwidth . 'x' . (int) $maxheight) . '/';
// Use $CFG->themerev to prevent browser caching when the file changes.
return moodle_url::make_pluginfile_url(context_system::instance()->id, 'core_admin', 'logocompact', $filepath,
theme_get_revision(), $logo);
}