Media Wiki Configure Site Logo: Difference between revisions

From NovaOrdis Knowledge Base
Jump to navigation Jump to search
No edit summary
 
(5 intermediate revisions by the same user not shown)
Line 1: Line 1:
=External=
=External=
* https://www.mediawiki.org/wiki/Manual:$wgLogo
* https://www.mediawiki.org/wiki/Manual:$wgLogos
=Internal=
=Internal=
* [[Media_Wiki_Operations#Configure_Site_Logo|Media Wiki Operations]]
* [[Media_Wiki_Concepts#Site_Logo|MediaWiki Concepts]]
* [[Media_Wiki_Concepts#Site_Logo|MediaWiki Concepts]]
=Overview=
=Overview=
Add to [[Media_Wiki_Concepts#LocalSettings.php|LocalSettings.php]]:
Add to [[Media_Wiki_Concepts#LocalSettings.php|LocalSettings.php]]:
<syntaxhighlight lang='php'>
<syntaxhighlight lang='php'>
$wgLogo = 'resources/assets/cat.png';
$wgLogos = [
'1x' => "resources/assets/cat.png", // path to 1x version
'1.5x' => "path/to/1.5x_version.png", // Optional, path to 1.5x version
'2x' => "path/to/2x_version.png", // Optional, path to 2x version
'svg' => "path/to/svg_version.svg", // Optional, path to svg version
'icon' => "path/to/icon.png", // Optional, A version of the logo without wordmark and tagline
'wordmark' => [
'src' => "path/to/wordmark_version.png", // Optional, 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", // Optional, path to tagline version
'width' => 135,
'height' => 15,
],
];
</syntaxhighlight>
</syntaxhighlight>
The value should be a relative path from DOCUMENT_ROOT.
The value should be a relative path from DOCUMENT_ROOT.


⚠️ 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.
⚠️ Do not simply overwrite the default logo installed with MediaWiki <code>/resources/assets/wiki.png</code>. This file will automatically be overwritten when you upgrade and your changes will be lost.

Latest revision as of 19:06, 29 December 2023

External

Internal

Overview

Add to LocalSettings.php:

$wgLogos = [
 '1x' => "resources/assets/cat.png",		// path to 1x version
	'1.5x' => "path/to/1.5x_version.png",	// Optional, path to 1.5x version
	'2x' => "path/to/2x_version.png",	// Optional, path to 2x version
	'svg' => "path/to/svg_version.svg",	// Optional, path to svg version
	'icon' => "path/to/icon.png",		// Optional, A version of the logo without wordmark and tagline
	'wordmark' => [
		'src' => "path/to/wordmark_version.png", // Optional, 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",	 // Optional, path to tagline version
		'width' => 135,
		'height' => 15,
	],
];

The value should be a relative path from DOCUMENT_ROOT.

⚠️ 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.