Jump to content

Manual talk:$wgLogos

Add topic
From mediawiki.org
Latest comment: 1 month ago by Dcljr in topic Removed text

DOCUMENT_ROOT

[edit]

The reference to DOCUMENT_ROOT is confusing. Basically, the value will be interpreted as a URL right? (Which could be absolute or relative with an absolute path.) Tgr (WMF) (talk) 21:47, 22 August 2020 (UTC)Reply

Logo types

[edit]

What's the difference between icon / 1x / svg? The page should explain that. AIUI icon will be used when the wordmark is displayed separately, while 1x / 2x / svg will be used on its own and is expected to include the wordmark? Tgr (WMF) (talk) 21:48, 22 August 2020 (UTC)Reply

SVG 1x

[edit]

Why is the SVG version of the wordmark keyed with 1x and not svg? Is that a typo? Tgr (WMF) (talk) 21:51, 22 August 2020 (UTC)Reply

Wordmark size

[edit]

What are the expected dimensions of the wordmark? From the documentation I gather it will be resized, but it's still useful to know the actual size so the asset can be made as small as possible. Tgr (WMF) (talk) 21:52, 22 August 2020 (UTC)Reply

Apparently it does not get resized. Some documentation about what size to use would be important here.
On Wikimedia wikis it seems the wordmark is 25px high (although it's made up of multiple images so presumably configured differently, but that seems like a good target). Tgr (WMF) (talk) 21:59, 22 August 2020 (UTC)Reply

Tagline

[edit]

I see beta enwiki also has a tagline image. Where is that configured? Tgr (WMF) (talk) 21:55, 22 August 2020 (UTC)Reply

Dugg around a bit in WMF site settings to see how to actually set icon, wordmark and tagline. Right now that looks like
$wgLogos array with variables defined over here André Costa (WMSE) (talk) 09:58, 2 September 2020 (UTC)Reply
Thanks! Added tagline to the docs. Tgr (WMF) (talk) 22:25, 3 September 2020 (UTC)Reply
fixed copy-pasta André Costa (WMSE) (talk) 07:14, 4 September 2020 (UTC)Reply

leftover text

[edit]

This text appears to have become separated from the paragraph to which it belongs:

Instead, the image will be cut off so that only part of it (the upper left-hand corner to be precise) will be visible. If this corner is completely white, it might look like the image would not display although in fact it does.

I haven't been able to figure out where it belongs, however. Woozle (talk) 17:51, 11 July 2021 (UTC)Reply

Meaning of 'svg: the key will be deprecated in future' in given context?

[edit]

I am finding the following guidance confusing:

The svg version replaces the need for a 1x, 1.5x, and 2x version, but should follow the same nominal size guidelines, fitting within 135px wide and 155px tall when resized to 135px wide. The key will be deprecated in future and its use is not recommended.

SVG can fulfil the need of three other keys, so do users need to use the three other keys, or do they need to prepare for SVG being deprecated? (It is hard to believe the SVG is being deprecated given this.) Beet keeper (talk) 12:49, 14 September 2021 (UTC)Reply

There's something confusing about all the text. The page needs rewriting, as actually $wgLogos is easy to understand, its just that the page makes it seem complicated. Also I can understand the need for having more sophisticated logo control, but the simpler single image method $wgLogo should have been left and not deprecated. It's just quicker and simpler especially for personal wiki's and so forth. Michael Z Freeman (talk) 17:11, 20 June 2022 (UTC)Reply

Why are images now stored in LocalSettings?

[edit]

With $wgLogos storing a binary encoded representation in this file means the majority of this file is hexidecimal values rather than the human-readable content that the settings of the site is supposed to represent. Are we going to be putting ALL images in this file going forward now? Why it wrong with linking the logo to a file containing the logo? 149.167.172.126 (talk) 22:43, 11 September 2022 (UTC)Reply

Hey there, I don't understand. There shouldn't be a binary representation in the file, it's an array of links as documented. Why do you think it's a binary representation? Jdforrester (WMF) (talk) 08:13, 12 September 2022 (UTC)Reply

Failed parsing 'srcset' attribute value since it has an unknown descriptor.

[edit]

After migating from wgLogo to wgLogos, I am getting multiple warnings for "Failed parsing 'srcset' attribute value since it has an unknown descriptor." and "Dropped srcset candidate ..." on Chrome console.

Here is my exact code on LocalSettings:

$mylogospath = "$wgScriptPath/customizations/logos/v02";

$wgLogos = [
	'1x' 	=> "$mylogospath/1x.png",
	'1.5x' 	=> "$mylogospath/1_5x.png",
	'2x' 	=> "$mylogospath/2x.png",
	'svg' 	=> "$mylogospath/vetor.svg",
	'icon' 	=> "$mylogospath/1x.png",	// A version of the logo without wordmark and tagline
	'wordmark' => [
		'src' => "$mylogospath/wm.png",	// path to wordmark version
		'1x'  => "$mylogospath/wm.svg",	// optional if you want to support browsers with SVG support with an SVG logo.
		'width' => 120,
		'height' => 25,
	],
];

And here is the console output:

Failed parsing 'srcset' attribute value since it has an unknown descriptor.
Failed parsing 'srcset' attribute value since it has an unknown descriptor.
Failed parsing 'srcset' attribute value since it has an unknown descriptor.
Failed parsing 'srcset' attribute value since it has an unknown descriptor.
Failed parsing 'srcset' attribute value since it has an unknown descriptor.
Failed parsing 'srcset' attribute value since it has an unknown descriptor.
Dropped srcset candidate "/w/customizations/logos/v02/vetor.svg"
Dropped srcset candidate "/w/customizations/logos/v02/1x.png"
Dropped srcset candidate "Array"
Dropped srcset candidate "/w/customizations/logos/v02/vetor.svg"
Dropped srcset candidate "/w/customizations/logos/v02/1x.png"
Dropped srcset candidate "Array"

Here's the generated img tag on my wiki:

<img alt="Mediawiki" decoding="auto" src="/w/customizations/logos/v02/1x.png" srcset="/w/customizations/logos/v02/1_5x.png 1.5x, /w/customizations/logos/v02/2x.png 2x, /w/customizations/logos/v02/vetor.svg svg, /w/customizations/logos/v02/1x.png icon, Array wordmark"/>

So, the thing is Mediawiki is passing invalid descriptors to the srcset attribute of the img tag, namely 'svg', 'icon' and 'wordmark'.

Any thoughts??

Cheers Rbirmann (talk) 09:29, 5 November 2022 (UTC)Reply

Which skin are you using? MediaWiki doesn't output the logo itself, skins are responsible for that.
A quick search on https://codesearch.wmcloud.org/skins/?q=decoding&i=nope&files=&excludeFiles=&repos= suggests it's Skin:Timeless causing this. Mainframe98 talk 11:02, 5 November 2022 (UTC)Reply
It is Timeless indeed. Rbirmann (talk) 14:25, 5 November 2022 (UTC)Reply
Thanks for confirming. I've created phab:T322475. Mainframe98 talk 18:24, 5 November 2022 (UTC)Reply

What file is $wgLogos in and where is that file?

[edit]

It seems like this page would include that info. Awfki (talk) 00:58, 10 May 2023 (UTC)Reply

Ooh! I found this "(Note: The default value of this variable depends on other variables, such as the values set in Setup.php, after LocalSettings.php is executed)" but I would note that anything in parenthesis is, by definition, not going to grab the eye.
I suggest that there should be a line that something like "Variable is set in: LocalSettings.php" or something similarly obvious. I looked at that page several times before I noticed the line in parens. And of course that was right after I asked because you can't find the answer until you ask someone. Awfki (talk) 01:03, 10 May 2023 (UTC)Reply

Order of preference for logos

[edit]

Any information on the order of preference and rules for choosing which logo file will be used?

If this varies by skin then vector-2022, Skin:Timeless and Skin:Monobook information would be most useful.

Is the logo chosen to display also dependent on viewer's screen size? Does the responsive user preference affect this?

Which classes relate to which files would also be helpful to know, particularly .mw-logo-container.

Logos that can be defined are:

  • 1x (135w up to 155h) - used as background image
  • 1.5x (202w)
  • 2x (270w)
  • svg (deprecated and not recommended)
  • icon (50x50 or 100x100) .mw-logo-icon
  • wordmark (135w) .mw-logo-wordmark
  • tagline (135w) img.mw-logo-tagline
  • (no icon, use SITENAME in text) .#p-logo-text inheriting font/colors from .mw-logo-wordmark?

(icon, Wordmark and tag line appear to be used to combine into a single 3-part image)

On MW1.39 it appears that the text sitename may be overlaid on top of the Wordmark (when responsive on, for small screens) Amousey (talk) 23:57, 4 July 2023 (UTC)Reply

"The key will be deprecated"

[edit]

... is not a thing in software development.

Features are either deprecated, or not.

If they are planned for removal, they are deprecated now.

If they are not planned for removal, then mentioning deprecation in documentation makes no sense. Brnd12 (talk) 05:03, 19 September 2023 (UTC)Reply

In MediaWiki, "deprecation" is a formal process that involves documentation of how to migrate to the next step etc., which is not ready yet, so this is correct, if confusing. Jdforrester (WMF) (talk) 19:14, 19 September 2023 (UTC)Reply

I'm totally lost

[edit]

I updated from an old 1.31 Mediawiki to 1.39. My wiki logo is gone and I have not the slightest idea how to bring it back, because this manual goes over my noob head. I tried svg, it doesnt work. I tried icon, it doesnt work. And I don't understand what they want from me with this resize and nominally stuff.

I just want a single path for my logo, which is not required to be resizeable, has no tagline, no wordmark or other fancy things. This was once a simple function, who made it so complicated? And why is there no option for those, who just want to slap a logo in their wiki?

Why was $wgLogo decapitated and not just made a fallback? 2003:EE:9718:2D00:A5BE:217E:585B:BF3B (talk) 14:44, 28 October 2023 (UTC)Reply

Why was $wgLogo decapitated and not just made a fallback?

It is. If you do not set $wgLogos to anything, the wiki software will use the value of $wgLogo. However, if you have $wgLogos set, which the installer does, you'll get that value instead.
However, to just simply set it the way you probably want, replace the entry in LocalSettings.php with something like this:
$wgLogos = [
    '1x' => "$wgResourceBasePath/myCustomLogo.png",
];
(This is for if your wiki's logo is stored directly in the root directory of your copy of MediaWiki, and is called myCustomLogo.png.) Jdforrester (WMF) (talk) 13:34, 30 October 2023 (UTC)Reply

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

[edit]

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. Monocero (talk) 08:57, 9 November 2023 (UTC)Reply

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? Jonathan3 (talk) 10:50, 10 November 2023 (UTC)Reply
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 Monocero (talk) 09:30, 11 November 2023 (UTC)Reply
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. Jonathan3 (talk) 21:27, 11 November 2023 (UTC)Reply
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. Monocero (talk) 08:50, 12 November 2023 (UTC)Reply
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',? Jonathan3 (talk) 21:54, 12 November 2023 (UTC)Reply
This is the address for my logo:
[1]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 (talk) 08:04, 13 November 2023 (UTC)Reply
Hi. It's been a while and I still haven't received any help on how to resolve this issue. Monocero (talk) 17:38, 18 February 2024 (UTC)Reply
Maybe you're setting $wgLogos twice (by mistake) in your LocalSettings.php? Jonathan3 (talk) 23:29, 18 February 2024 (UTC)Reply
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 (talk) 21:36, 25 March 2024 (UTC)Reply
@Jonathan3
Where can I report this bug to the MediaWiki developers? Can you help me? Monocero (talk) 13:08, 25 April 2024 (UTC)Reply
@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' => '<nowiki>//www.golarze.pl/golarzopedia/images/logo/logo.png'</nowiki>,
  '1x' => '<nowiki>//www.golarze.pl/golarzopedia/images/logo/logo.png'</nowiki>,
];
IMO this should definitely be included in the Manual because it's what's required for the default Vector theme after all! Iridescentstarling (talk) 15:18, 27 May 2024 (UTC)Reply
@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 (talk) 10:53, 5 August 2024 (UTC)Reply
@Bawolff
Would you be able to answer this for me? Monocero (talk) 20:06, 5 August 2024 (UTC)Reply
You can change the logo image to one that is bigger Bawolff (talk) 00:45, 6 August 2024 (UTC)Reply
The logo file has a size of 150x150, but this size does not display in Vector 2022 Monocero (talk) 10:02, 6 August 2024 (UTC)Reply
@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. Monocero (talk) 15:05, 25 August 2024 (UTC)Reply
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 DennisPaulBurdick (talk) 16:24, 3 December 2024 (UTC)Reply

Add minimal example

[edit]

The following discussion is closed. Please do not modify it. Subsequent comments should be made on the appropriate discussion page. No further edits should be made to this discussion.


There should be a simple minimal example. Ideally this would also only use options not planned to be deprecated in the future, but promoting the use of the icon version only might break with some skins for now. I'm relatively new to MediaWiki and thus not editing the Manual directly, but this is my proposal:

$wgLogos = [
	'1x' => "path/to/1x_version.png",		// path to 1x version
];
Kerel-fs (talk) 13:30, 23 February 2024 (UTC)Reply
$wgLogos = [
       '1x' => "{$wgScriptPath}/myCustomLogo.png"               // path to 1x version
];
... worked for me. Kjecl (talk) 18:50, 11 April 2024 (UTC)Reply
I've added a "simple example" section, hope this helps. Jdforrester (WMF) (talk) 19:34, 11 April 2024 (UTC)Reply
The discussion above is closed. Please do not modify it. No further edits should be made to this discussion.

Removed text

[edit]
After some text was removed in 2021, the following text no longer made any sense, so I removed it and put it here:
<translate><!--T:14--> Instead, the image will be cut off so that only part of it (the upper left-hand corner to be precise) will be visible.</translate>
<translate><!--T:15--> If this corner is completely white, it might look like the image would not display, although in fact it does.</translate>
Someone should look into whether any of this is worth putting back in the article. According to the edit summary linked to above, resizing is only not done for the 1x version. I don't know if that's still true. - dcljr (talk) 02:50, 13 August 2025 (UTC)Reply
Nevermind. I didn't notice that this information is (still) given in the "tip" box at the top of Manual:$wgLogos#Details. - dcljr (talk) 02:23, 25 August 2025 (UTC)Reply