Hello,
For those who were not following the forum threat in which I enquired about the possibility of creating a child/clone theme of Essential so that I could customise a different banner for certain courses and categories, I attach the link to the solution:
https://www.dropbox.com/s/4wqir85bwdveo3k/essentials.zip?dl=0
Following Gareth's advice:
1) I have used the /essentials/ child them which is contained within Essential as a subfolder,
2) Within the child theme Essentials, I have created a settings.php folder containing the text:
<?php
defined('MOODLE_INTERNAL') || die;
if ($ADMIN->fulltree) {
// Logo file setting.
$name = 'theme_essentials/logo';
$title = get_string('logo','theme_essentials');
$description = get_string('logodesc', 'theme_essentials');
$setting = new admin_setting_configstoredfile($name, $title, $description, 'logo');
$setting->set_updatedcallback('theme_reset_all_caches');
$settings->add($setting);
}
3) Then in the file theme /Essentials/config.php comment the lines:
$THEME->parents_exclude_sheets = array(
'essential' => array(
'essential-alternative',
'essential-settings',
'custom'
)
); */
4) in the file /theme/essentials/lib.php
additing the part for uploading the logo from the admin menu settings of the theme
function theme_essentials_process_css($css, $theme) {
// Set the background image for the logo.
$logo = $theme->setting_file_url('logo', 'logo');
$css = \theme_essential\toolbox::set_logo($css, $logo);
5) and to use the rest of the settings from essential, we change the variable to true;
$usingessentialsettings = true;
6) Finally, in the same theme/essentials/lib.php file we add this part to display only the logo (in my case I didn't want alternative text):
function theme_essentials_pluginfile($course, $cm, $context, $filearea, $args, $forcedownload, array $options = array()) {
static $theme;
if (empty($theme)) {
$theme = theme_config::load('essentials');
}
if ($context->contextlevel == CONTEXT_SYSTEM) {
if ($filearea === 'logo') {
return $theme->setting_file_serve('logo', $args, $forcedownload, $options);
}
else {
send_file_not_found();
}
}
}
7) We add the language strings corresponding to the settings menu for the logo at themes/essentials/lang/en/theme_essentials.php (for English language):
$string['logo'] = 'Logo';
$string['logodesc'] = 'Enter the URL to an image to use as the logo for this site. Should be http://www.yoursite.com/path/to/logo.png';