Jump to content

Manuel:$wgAppleTouchIcon

From mediawiki.org
This page is a translated version of the page Manual:$wgAppleTouchIcon and the translation is 42% complete.
URLs de serveur et chemins de fichiers: $wgAppleTouchIcon
URL facultative vers une icône à utiliser lorsque l'on crée un signet vers la page d'accueil sur les appareils mobiles Apple
Introduit dans la version :1.12.0 (r29942)
Retiré dans la version :Encore utilisé
Valeurs autorisées :(chemin relatif ou URL absolue)
Valeur par défaut :false

Détails

Apple's iPhone, iPod Touch and iPad devices have the ability to display an icon when you save a bookmark onto the home screen from Safari. This is somewhat similar to a favicon, but with larger sizes (57x57, 72x72, 114x114 and 144x144 pixels, depending on the device).

Safari Web Content Guide recommends to place a file named "apple-touch-icon.png" in your web site's document root directory; use "apple-touch-icon-precomposed.png" to avoid the iOS-created rounded corners and glossy shine effect for your icon. However, if for some reason you want to use a custom-set icon, you can use the following format:

$wgAppleTouchIcon = "/wiki/icons/apple-touch-icon.png";

Ceci produit une balise ‎<link> dans l'entête HTML de la sortie :

<link rel="apple-touch-icon" href="/wiki/icons/apple-touch-icon.png" />

As $wgAppleTouchIcon is set to false by default, MediaWiki will not generate the link, and the browser will attempt to load "/apple-touch-icon.png". If this doesn't exist either, a thumbnail of the page is used which is not very attractive.

Using the override option, wikis may set a different icon from other pages on the same host, or may simply choose to set a custom URL.

For Android devices place "apple-touch-icon-precomposed.png" in your root directory, and include $wgAppleTouchIcon = "$wgScriptPath/apple-touch-icon-precomposed.png"; in LocalSettings.php.

Lignes de conduite

An iPhone home screen including some custom site icons.

Clean images with good sharpness and contrast and a bright colored background will fit in reasonably well with other icons. If you don't have one to test with, refer to handy screen shots such as the one here.

Apple documentation recommends a 114×114 pixel PNG image; however, 118×120 seems to be the mark for retina displays. A smaller image is scaled up slightly, becoming a bit blurry. Wikimedia projects currently (May 2021) use 152×152 pixel.

Rounded corners and a "glossy" texture are added by the iPhone UI, so use a flat, square background in your source image:

Image originale: Comme rendu:

Les milieux transparents sont rendus comme noir solide.


Voir aussi