Jump to content

Handbuch:$wgLogos

From mediawiki.org
This page is a translated version of the page Manual:$wgLogos and the translation is 32% complete.
Outdated translations are marked like this.
Server-URLs und Dateipfade: $wgLogos
Der URL-Pfad zu verschiedenen Wiki-Logos.
Eingeführt in Version:1.35.0 (Gerrit change 562588; git #8cd2e133)
Entfernt in Version:Weiterhin vorhanden
Erlaubte Werte:(Array (Feld) mit Faktoren und relativem Pfad oder URLs)
Standardwert:false
(Hinweis: The default value of this variable depends on other variables, such as the values set in Setup.php , after LocalSettings.php is executed.)

This variable in LocalSettings.php specifies the location of one or more files to be used as the site logo. (z.B. das sichtbare Bild in der oberen linken Ecke der Seite der meisten MediaWiki Installationen).

Ein Array (Feld) mit Faktoren und seinen verbundenen relativen Pfaden oder URL-Pfad zu unterschiedlichen Versionen des Wiki-Logos.

This replaces $wgLogo , which was used before MediaWiki 1.35 .

Details

Achtung! Achtung: Do not simply overwrite the default logo installed at MediaWiki (/resources/assets/wiki.png); this file will be overwritten when you upgrade the software.
The recommended size of a square logo for the legacy Vector skin is 135×135 pixels for a raster image (e.g., PNG) and 50×50 (nominally) for a vector image (SVG), though the logo does not have to be square, especially if it includes text below a picture, like Wikipedia's logo from 2010. The recommended logo size in the newer Vector 2022 skin is 100×100 pixels for raster and 50×50 (nominally) for vector. The maximum logo size in legacy Vector is about 160×160 pixels, while in MonoBook it's about 155×155.

Unterstützte Varianten

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. Beachte, dass andere Skins typischerweise grössere Icons benötigen, sofern sie dies unterstützen, empfiehlt es sich anstatt dessen SVG zu nutzen, da es dies korrekt über alle skaliert. Es sollte ein Viereck sein und sollte nominal 50x50 Pixel für ein SVG oder 100x100 Pixel haben, wenn das Raster HiDPI unterstützen soll. Derzeitige Unterstützung für diesen Key ist auf $1 beschränkt, aber dies wird für alle Skins empfohlen.
1x
This is used by the legacy Vector and MonoBook skins, and some others.[clarification needed] es sollte 135px breit und bis zu ~155px hoch sein. Dies ist, weil die 1.5x und 2x Versionen eine nominale breite von 135px und bis zu 155px Höhe erwarten, sodass dies ohne Probleme in Standard-Skins passt.[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. Das unterstützt ältere Skins und in der weiteren Zukunft ausgesetzt wird. Wir empfehlen Skins die bevorzugte 'Icon' unterstützen.
1.5x
Diese sollte 202px breit und zum Abbildungsmassstab von 1x passend. Der Key wird zukünftig ausgesetzt und seine Verwendung wird nicht empfohlen.
2x
es sollte 270px breit sein, passend zum Abbildungsmassstab von 1x. Der Key wird zukünftig ausgesetzt und seine Verwendung wird nicht empfohlen.
svg
es ersetzt die Notwendigkeit der 1x, 1.5x und 2x Version, aber sollte den nominalen Richtlinien/Vorgaben des Abbildungsmassstab folgen, passend zu 135px Breite und 155px Höhe, wenn es auf 135px Breite vergrössert wird. Der Key wird zukünftig ausgesetzt und seine Verwendung wird nicht empfohlen.

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 and height 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

Beispiel

$wgLogos = [
	'1x' => "Pfad zur 1x-Version.png",
	'1.5x' => "Pfad zur 1.5x-Version.png",
	'2x' => "Pfad zur 2x-Version.png",
	'svg' => "Pfad zur 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

There is no special significance to the choices of whether to use relative file paths or URLs in this example.
$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,
	],
];

Logos für Sprachvarianten hinzufügen

The functionality to override logos for different language variants was introduced in version 1.36.0 (Gerrit change 627939, git #8cd2e133). Siehe 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",      // Pfad zur 1x-Version
	'1.5x' => "path/to/1.5x_version.png",  // Pfad zur 1.5x-Version
	'2x' => "path/to/2x_version.png",      // Pfad zur 2x-Version
	'svg' => "path/to/svg_version.svg",    // Pfad zur 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,
			],
		],
	],
];

Siehe auch