Manual:$wgLogos/pl
Server URLs and file paths: $wgLogos | |
---|---|
The URLs or file paths to various wiki logos. |
|
Wprowadzono w wersji: | 1.35.0 (Gerrit change 562588; git #8cd2e133) |
Usunięto w wersji: | nadal w użyciu |
Dozwolone wartości: | (array of keys and associated relative paths or URLs) |
Domyślna wartość: | false (Uwaga: Domyślna wartość tej zmiennej zależy od innych zmiennych, takich jak wartości ustawione w Setup.php po wykonaniu LocalSettings.php ) |
Inne ustawienia: Alfabetycznie | Według funkcji |
This variable in LocalSettings.php specifies the location of one or more files to be used as the site logo. (The image displayed in the upper-left corner of every page in most MediaWiki installations.)
Its value is an associative array with keys and their corresponding relative file paths or URLs to various versions of the wiki logo.
This replaces $wgLogo , which was used before MediaWiki 1.35 .
Szczegóły
![]() | Do not simply overwrite the default logo installed at MediaWiki (/resources/assets/wiki.png ); this file will be overwritten when you upgrade the software. |
![]() | Depending on your server settings, the information about which image to use may be cached on the server. Images may also be cached inside of web browsers for a long time, so you might not immediately see a new logo when you change an image file. In this case it might be necessary to empty all relevant caches and to reload the image URL in your web browser so the current version is retrieved from the server. |
Supported keys
- icon
- This is used for the site logo in the Vector 2022 skin, where it is shown at 50×50 pixels (or SVG equivalent), and in the Timeless , Refreshed , Citizen skins, where it is typically shown at larger sizes. Using an SVG is recommended, as it will scale correctly across all of them. Otherwise, the image should be square and 100×100 pixels if a raster image like PNG in order to support HiDPI. Current support for this key is limited to the skins previously mentioned, but supporting it is recommended for all new skins.
- 1x
- This is used by the legacy Vector and MonoBook skins, and some others.[clarification needed] The image should be 135px wide by up to around 155px tall. This is because the 1.5x and 2x versions assume a nominal width of 135px, and up to 155px tall will fit without issues in standard skins.[clarification needed] A larger size logo can be used by modifying the site's CSS, but MediaWiki will not shrink a logo that is too large. Instead, only part of the image (specifically the upper left-hand corner) will be visible, and if this corner is white it may seem like the image is not being displayed at all. This key is still used by older skins, but in the long-term future it will be deprecated. We recommend skins support the preferred key,
icon
. - 1.5x
- This image should be 202px wide and match the aspect ratio of the 1x image (so up to 232px tall, for 155px nominal height). As with
1x
, this key will be deprecated in the future, so its use is not recommended. - 2x
- This image should be 270px wide and match the aspect ratio of the 1x image (so up to 310px tall, for 155px nominal height). As with
1x
, this will be deprecated in the future, so its use is not recommended. - svg
- This is used for SVG logos instead of the separate
1x
,1.5x
,2x
keys, but should follow the same size guidelines (nominally) as those keys, fitting within 135px wide and 155px tall when sized to 135px wide. This key will be deprecated in the future, so its use is not recommended.
There are also two optional fields for additional assets to show next to the logo:
- wordmark
- This should be a landscape image (wider than it is tall), with its maximum width and height set by the
width
andheight
keys. The width should not exceed 124px and the height should not exceed 32px. Typically this is a graphical version of the text in $wgSitename (for example, "Wikipedia"). It is used in the Vector 2022 (1.36+), Timeless , Minerva , and Citizen skins. - tagline
- The requirements here are the same as for the wordmark. The image typically depicts the non-sitename part of MediaWiki:Tagline (for example, "The Free Encyclopedia"). The combined height of the tagline and wordmark should not exceed 50px.
All values (except width
and height
) can be either a fully-qualified URL or a relative path from the document root (i.e., the directory where MediaWiki was installed ).
If it's a relative path, it has to start with a slash (i.e., a file in the document root is /file.png, not file.png).
Example images
Przykład
$wgLogos = [
'1x' => "path/to/1x_version.png",
'1.5x' => "path/to/1.5x_version.png",
'2x' => "path/to/2x_version.png",
'svg' => "path/to/svg_version.svg",
'icon' => "path/to/icon.png", // version of logo without wordmark and tagline
'wordmark' => [
'src' => "path/to/wordmark_version.png",
'1x' => "path/to/wordmark_version.svg", // optional: support SVG in addition to PNG
'width' => 135,
'height' => 20,
],
'tagline' => [
'src' => "path/to/tagline_version.png",
'width' => 135,
'height' => 15,
],
];
Simple example
$wgLogos = [
'icon' => "$wgScriptPath/lol.png", // path to primary logo for Vector 2022
'1x' => "$wgScriptPath/myCustomLogo.png", // path to 1x version for other skins
'2x' => "$wgResourceBasePath/hiResLogo.png", // path to 2x version for other skins
];
Example paths
$wgLogos = [
'1x' => "/lol.png", // relative path to file in document root
'1.5x' => "https://mywiki.org/w/resources/assets/lol.png", // full URL to elsewhere
'2x' => "/lol.png", // relative paths always start with a slash
// 'svg' => "", // svg key has been deprecated
'icon' => "/lol.png", // 50×50 SVG or 100×100 PNG (limited support)
'wordmark' => [
'src' => "/wordmark_sitename.png", // image of sitename text (limited support)
'width' => 135,
'height' => 20,
],
'tagline' => [
'src' => "/tagline_subtitle.png", // image of tagline text without sitename (limited support)
'width' => 135,
'height' => 15,
],
];
Adding logos for language variants
The functionality to override logos for different language variants was introduced in version 1.36.0 (Gerrit change 627939, git #8cd2e133). See T261153.
When defining variants, any language key can be used, for example it is possible to provide a German variant of an English logo.
This was extended to apply to all logo keys in 1.39.0.
$wgLogos = [
'1x' => "path/to/1x_version.png", // path to 1x version
'1.5x' => "path/to/1.5x_version.png", // path to 1.5x version
'2x' => "path/to/2x_version.png", // path to 2x version
'svg' => "path/to/svg_version.svg", // path to svg version
'icon' => "path/to/icon.png", // A version of the logo without wordmark and tagline
'wordmark' => [
'src' => "path/to/wordmark_version.png", // path to wordmark version
'1x' => "path/to/wordmark_version.svg", // optional if you want to support browsers with SVG support with an SVG logo.
'width' => 135,
'height' => 20,
],
'tagline' => [
'src' => "path/to/tagline_version.png", // path to tagline version
'width' => 135,
'height' => 15,
],
'variants' => [
'variant-code' => [
'1x' => "path/to/language_variant_1x_version.png", // path to 1x version in language variant
'1.5x' => "path/to/language_variant_1.5x_version.png", // path to 1.5x version in language variant
'2x' => "path/to/language_variant_2x_version.png", // path to 2x version in language variant
'svg' => "path/to/language_variant_svg_version.svg", // path to svg version in language variant
'icon' => "path/to/language_variant_icon.png", // A version of the logo without wordmark and tagline in language variant
'wordmark' => [
'src' => "path/to/language_variant_wordmark_version.png", // path to wordmark version in language variant
'1x' => "path/to/language_variant_wordmark_version.svg", // optional if you want to support browsers with SVG support with an SVG logo in language variant.
'width' => 135,
'height' => 20,
],
],
],
];
Zobacz też
- How do I change the logo?
- $wgLogo (MediaWiki < 1.35.0)
- $wgLogoHD (MediaWiki < 1.35.0)
- $wgFavicon
- $wgAppleTouchIcon