Topic on Manual talk:$wgLogos

The code to display the logo does not work (Vector 2022)

9
Monocero (talkcontribs)

Hi, I have set the Vector 2022 skin as the main skin for my MediaWiki, unfortunately the logo is not displayed. Old and new code not working. I have a logo file in the main Mediawiki folder/images/logo and unfortunately I no longer have any idea why the logo is not showing on my MediaWiki.

This old code doesn't work:

$wgLogo = "{$wgScriptPath}/images/logo/logo.png";

This new code doesn't work either:

$wgLogos = [

   '1x' => "$wgResourceBasePath/images/logo/logo.png",

];

This code doesn't work either:

$wgLogos = [

   '1x' => "/images/logo/logo.png",     // Ścieżka do wersji 1x (PNG)
   '1.5x' => "/images/logo/logo.png",  // Ścieżka do wersji 1.5x (PNG)
   '2x' => "/images/logo/logo.png",     // Ścieżka do wersji 2x (PNG)
   'svg' => "/images/logo/logo.svg",   // Ścieżka do wersji SVG (preferowana)

];

Please help.

Jonathan3 (talkcontribs)

I'm going to guess that $wgScriptPath is not empty, which would mean that "{$wgScriptPath}/images/logo/logo.png" and "/images/logo/logo.png" are different. What happens when you update the $wgLogos array accordingly?

Monocero (talkcontribs)

If I understood correctly, I removed the old code from the file:

$wgLogo = "{$wgScriptPath}/images/logo/logo.png";

And I added this code:

$wgLogos = [

   '2x' => "/images/logo/logo.png",     // Ścieżka do wersji 2x (PNG)

];

And unfortunately my logo is not displayed, only this is displayed:

https://i.imgur.com/Vr7wl8V.png

So why is the path to the logo incorrect when the logo.png file is located in the main MediaWiki/images/logo/ folder

Jonathan3 (talkcontribs)

Why not try what I suggested above? Each time you see "/images/logo/logo.png" replace it with "{$wgScriptPath}/images/logo/logo.png".

Likely $wgScriptPath is "https://www.example.com" so it'll mean you end up with the URL of your logo.

Monocero (talkcontribs)

If you mean code like this:

$wgLogos = [

   '1x' => "$wgScriptPath/images/logo/logo.png",
   '1.5x' => "$wgScriptPath/images/logo/logo.png",
   '2x' => "$wgScriptPath/images/logo/logo.png",
   'svg' => "$wgScriptPath/images/logo/logo.svg",

];

Unfortunately, this code does not display the logo in Vector 2022 either. It is strange that the official MediaWiki code does not work on my Wiki.

Jonathan3 (talkcontribs)

What URL can you type into the web browser to display the logo on its own?

What happens when you use that each time, e.g. '1x' => 'https://www.example.com/images/logo/logo.png',?

Monocero (talkcontribs)
Monocero (talkcontribs)

Hi. It's been a while and I still haven't received any help on how to resolve this issue.

Jonathan3 (talkcontribs)

Maybe you're setting $wgLogos twice (by mistake) in your LocalSettings.php?

Reply to "The code to display the logo does not work (Vector 2022)"