Manual:$wgLogos/fa
| آدرسهای سرور و مسیرهای فایل: $wgLogos | |
|---|---|
| نشانیهای اینترنتی یا مسیرهای پرونده به نشانوارههای مختلف ویکی. |
|
| معرفی شده در نسخه: | 1.35.0 (Gerrit change 562588; git #8cd2e133) |
| حذف شده در نسخه: | هنوز در حال استفاده است |
| مقادیر مجاز: | (array of keys and associated relative paths or URLs) |
| مقدار پیشفرض: | false(Note: 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. The site logo is a standard interface element of most MediaWiki skins and is most commonly recognisable as the image displayed in the upper-left corner of every page.
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 مدیاویکی ۱٫۳۵.
جزئیات
فقط نشانوارهٔ پیشفرض نصبشده در مدیاویکی را جایگزین نکنید (/resources/assets/wiki.png); این پرونده هنگام ارتقاء نرمافزار رونویسی خواهد شد. |
بسته به تنظیمات سرور شما، اطلاعات مربوط به تصویری که باید استفاده شود ممکن است در سرور ذخیره شود. همچنین ممکن است تصاویر برای مدت طولانی در مرورگرهای وب ذخیره شوند، بنابراین ممکن است هنگام تغییر یک پرونده تصویری، فوراً نشانوارهٔ جدید را مشاهده نکنید. در این حالت، ممکن است لازم باشد تمام حافظههای پنهان (cache) مربوطه را خالی کنید و نشانی اینترنتی (URL) تصویر را در مرورگر وب خود مجدداً بارگذاری کنید تا نسخه فعلی از سرور بازیابی شود. |
کلیدهای پشتیبانیشده
- 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 (removed in 1.46)
- 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,2xkeys, 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 monochrome[1] image (wider than it is tall), with its maximum width and height set by the
widthandheightkeys. 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).
تصاویر نمونه
کد نمونه
$wgLogos = [
'1x' => "path/to/1x_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,
],
];
مثال ساده
$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
];
مسیرهای نمونه
$wgLogos = [
'1x' => "/lol.png", // relative path to file in document root
'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,
],
];
افزودن نشانواره برای انواع زبان
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
'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
'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,
],
],
],
];
همچنین ببینید
- ↑ Minerva and Wikimedia brand guidelines expects the wordmark to be monochrome. Colors should be limited to the icon component.