-2

I replaced Moodle logo with a logo of my web place keeping the same file name and file size and the new logo shows up when I run my website in Firefox or Edge, but the logo doesn't show up in Chrome, Brave and maybe other web browsers. What I did:

  • I put my logo in this file: /pix/moodlelogo_grayhat.png
  • I changed logo link in: /lib/outputrenderers.php If someone wants to take a look, this is my website.

Thank you in advance!

isherwood
  • 58,414
  • 16
  • 114
  • 157
Laki
  • 99
  • 1
  • 3
  • 15
  • Links to a site aren't considered adequate on SO. Please post your HTML snippet and any relevant CSS here, in your question. – isherwood May 28 '20 at 13:44

2 Answers2

1

Your theme's markup doesn't contain the filename extension. For some reason (either server configuration or file problems) the browser thinks that the image is an SVG file.

enter image description here

The best solution may be to modify the theme to add .png to the markup. If the filename is dynamically injected via template code you may just need to rename the file with the extension present.

isherwood
  • 58,414
  • 16
  • 114
  • 157
  • I guess that the filename is injected dynamically. I can't rename the file with the extension here because it doesn't work: `code`''.get_string('moodlelogo').'`code` – Laki May 28 '20 at 14:40
  • There are also both files at the same location - .png and .svg – Laki May 28 '20 at 14:44
0

Based on what @isherwood said, I fixed this problem. I edited outputrenderers.php (/lib folder) where the filename was dynamically injected from.

It was:

<img src="' . $this->image_url('moodlelogo_grayhat') . '" alt="'.get_string('moodlelogo').'" /></a>

I put instead:

<a title="MyWeb" href="https://mywebplace.com/">
 <img alt="MyWeb" src="https://mywebplace.com/pix/moodlelogo_grayhat.png"></a>

Thanks.

Laki
  • 99
  • 1
  • 3
  • 15