Jump to content

Topic on Manual talk:$wgLogos/Flow

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

18
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)

This is the address for my logo:

https://www.golarze.pl/golarzopedia/images/logo/logo.png

Maybe it's a bad logo? But this way doesn't work either:

$wgLogos = 
   '1x' => 'https://www.golarze.pl/golarzopedia/images/logo/logo.png',
   '1.5x' => 'https://www.golarze.pl/golarzopedia/images/logo/logo.png',
   '2x' => 'https://www.golarze.pl/golarzopedia/images/logo/logo.png',
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?

Monocero (talkcontribs)

No, when I added this code, this logo displays on Wektor 2010 but not on Wektor 2022.

$wgLogos = [ '1x' => "$wgScriptPath/images/logo/logo.png", // Ścieżka do wersji 1x (PNG) ];

I have no idea why the logo is not displayed on Vector 2022. It must be a bug in Vector 2022.

Monocero (talkcontribs)

@Jonathan3

Where can I report this bug to the MediaWiki developers? Can you help me?

Iridescentstarling (talkcontribs)

@Monocero I had exactly the same issue until I noticed on wikipedia.org that the element showing the logo was actually the ICON! I duplicated my '1x' to 'icon' and then it finally showed up.

So for your example this should be:

$wgLogos = [
  'icon' => '//www.golarze.pl/golarzopedia/images/logo/logo.png',
  '1x' => '//www.golarze.pl/golarzopedia/images/logo/logo.png',
];

IMO this should definitely be included in the Manual because it's what's required for the default Vector theme after all!

Monocero (talkcontribs)

@Iridescentstarling

Thank you for the information. It works this way, but the logo is displayed small at 50x50. Is there anything I can do to make it appear larger?

Monocero (talkcontribs)

@Bawolff

Would you be able to answer this for me?

Bawolff (talkcontribs)

You can change the logo image to one that is bigger

Monocero (talkcontribs)

The logo file has a size of 150x150, but this size does not display in Vector 2022

Monocero (talkcontribs)

@Bawolff

Why can't the graphic logo in Vector 2022 be displayed, e.g. 150x150, only as a small icon? It's been a long time since I started this help thread and I still don't know.

DennisPaulBurdick (talkcontribs)

Any word on this yet? I've been using Mediawiki for years & have never had a problem until this latest version. I think I've tried every permutation, and nothing works.


OS: Linux ????? 6.11.10-300.fc41.x86_64 #1 SMP PREEMPT_DYNAMIC Sat Nov 23 00:51:20 UTC 2024 x86_64 GNU/Linux

Wiki RPM: mediawiki-1.41.1-2.fc41.src.rpm

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