Last active
December 19, 2015 22:28
-
-
Save sebcunin/6027300 to your computer and use it in GitHub Desktop.
Pour ajouter les apple-icon seulement pour un thème Drupal.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| /** | |
| * Ajouter les méta spécifiques aux Devices Apples | |
| * */ | |
| function THEME_NAME_preprocess_html(&$variables) { | |
| //regular apple-touch-icon | |
| $apple = array( | |
| '#tag' => 'link', // The #tag is the html tag - <link /> | |
| '#attributes' => array( // Set up an array of attributes inside the tag | |
| 'rel' => 'apple-touch-icon', | |
| 'href' => path_to_theme() .'/apple-touch-icon.png', | |
| ), | |
| ); | |
| drupal_add_html_head($apple, 'apple-touch'); | |
| // 72x72 apple-touch-icon | |
| $apple = array( | |
| '#tag' => 'link', | |
| '#attributes' => array( | |
| 'rel' => 'apple-touch-icon', | |
| 'href' => path_to_theme() . '/apple-touch-icon-72x72.png', | |
| 'sizes' => '72x72', | |
| ), | |
| ); | |
| drupal_add_html_head($apple, 'apple-touch-72'); | |
| // 114x114 apple-touch-icon | |
| $apple = array( | |
| '#tag' => 'link', | |
| '#attributes' => array( | |
| 'rel' => 'apple-touch-icon', | |
| 'href' => path_to_theme() . '/apple-touch-icon-114x114.png', | |
| 'sizes' => '114x114', | |
| ), | |
| ); | |
| drupal_add_html_head($apple, 'apple-touch-114'); | |
| ... | |
| } | |
| ?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment