Handbuch:$wgLogos

From mediawiki.org
This page is a translated version of the page Manual:$wgLogos and the translation is 49% complete.
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)

Details

Ein Array (Feld) mit Faktoren und seinen verbundenen relativen Pfaden oder URL-Pfad zu unterschiedlichen Versionen des Wiki-Logos. (z.B. das sichtbare Bild in der oberen linken Ecke der Seite der meisten MediaWiki Installationen).

Unterstützte Varianten

Die Icon Version
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. SVG wird jedoch aber empfohlen. Derzeitige Unterstützung für diesen Key ist auf Skin:Vector , Skin:Timeless , Skin:Refreshed , Skin:Citizen beschränkt, aber dies wird für alle Skins empfohlen. 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.
Die 1x Version
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. Das unterstützt ältere Skins und in der weiteren Zukunft ausgesetzt wird. Wir empfehlen Skins die bevorzugte 'Icon' unterstützen.
Die 1.5x Version
Diese sollte 202px breit und zum Abbildungsmassstab von 1x passend. (also bis zu 232px hoch, für 155px nominale Höhe.) Der Key wird zukünftig ausgesetzt und seine Verwendung wird nicht empfohlen.
Die 2x Version
es sollte 270px breit sein, passend zum Abbildungsmassstab von 1x. (also bis zu 310px hoch, für 155px nominale Höhe.) Der Key wird zukünftig ausgesetzt und seine Verwendung wird nicht empfohlen.
Die SVG Version
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
it should be a landscape logo, with maximum set width or height, as these are specified under the width and height keys. The width shouldn't exceed 124 and the height shouldn't exceed 32px. Typically this is the graphic version of $wgSitename. This is used in Skin:Vector (1.36), Skin:Timeless , Skin:Minerva , Skin:Citizen
tagline
the same is true for the tagline, which typically corresponds to the non-sitename part of MediaWiki:Tagline. The combined height of the tagline and wordmark should not exceed 50px.

All values (except width and height) can either be a fully-qualified URL or a relative path from DOCUMENT_ROOT. If it's a relative path, it has to start with a slash (a file in DOCUMENT_ROOT is /file.png, not file.png). 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.

Example images

Beispiel

$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,
	],
];


Simple example

$wgLogos = [
	'1x' => "$wgScriptPath/myCustomLogo.png",			// path to 1x version
	'2x' => "$wgResourceBasePath/hiResLogo.png",		// path to 2x version
];

Example paths

$wgLogos = [
	'1x' => "/logo_1x.png",												// relative path to file in logo folder, 1x version
	'1.5x' => "https://mywiki.org/w/resources/assets/logo_1.5x.png",	// fully qualified URL path to 1.5x version
	'2x' => "/logo_2x.png",												// relative path to 2x version, which always starts with a slash
	//  'svg' => "",													// no svg (deprecated by MW)
	'icon' => "icon.png",												// Limited support, either 50x50 svg or 100x100 png
	'wordmark' =>  [
		'src' => "/wordmark_sitename.png",								// 135px wide image of sitename text, limited support
		'width' => 135,
		'height' => 20,
   ],
	'tagline' => [
         'src' => "/tagline_subtitle.png",								// 135px image to tagline text without sitename
		'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,
			],
		],
	],
];
Achtung! Achtung: Do not simply overwrite the default logo installed with MediaWiki (/resources/assets/wiki.png). This file will automatically be overwritten when you upgrade and your changes will be lost.


Siehe auch