changing icons for a child theme

Re: changing icons for a child theme

by Martin Gauk -
Number of replies: 1
Hi Stefan,

yes, this is possible.

You need to set the icon system of your theme by adding the following line to the config.php of your theme:
$THEME->iconsystem = '\\theme_sth\\output\\icon_system_fa_custom';

The file /theme/sth/classes/output/icon_system_fa_custom.php may look something like this:
<?php

namespace theme_sth\output;

defined('MOODLE_INTERNAL') || die();

class icon_system_fa_custom extends \core\output\icon_system_fontawesome {
    public function get_core_icon_map() {
        $map = parent::get_core_icon_map();
        $map['core:i/navigationitem'] = 'fa-caret-right';
        return $map;
    }
}


Average of ratings: Useful (3)
In reply to Martin Gauk

Re: changing icons for a child theme

by Lívia Mendes -
Hi!

I did the exact same thing and it didn't changed a thing.
In my case, I've put Semantic UI in the theme that I'm developing and wanted to use its icons in the dashboard.

in theme/{themename}/classes/output/icon_system_fontawesome.php:
namespace theme_{themename}\output;

defined('MOODLE_INTERNAL') || die();

class icon_system_fontawesome extends \core\output\icon_system_fontawesome {
public function get_core_icon_map(){
$iconmap = parent::get_core_icon_map();

$overrides = Array(
'core:i/dashboard' => 'tachometer alternate icon',
);

$merged = array_merge($iconmap, $overrides);

return $merged;
}
}
And in config.php:
$THEME->iconsystem = '\\theme_{themename}\\output\\icon_system_fontawesome';
  • Moodle: 3.8
  • theme parent: boost
  • Boost version: 2019111800