Skip to content

Instantly share code, notes, and snippets.

View sebcunin's full-sized avatar

Sébastien Cunin sebcunin

View GitHub Profile
@sebcunin
sebcunin / weight_module
Last active December 21, 2015 19:18 — forked from jlavialle/weight_module
Modify the module's weight (#drupal)
/**
* Implements hook_enable()
* @link https://api.drupal.org/api/drupal/modules%21system%21system.api.php/function/hook_enable/7
*/
function MYMODULE_NAME_enable() {
db_update('system')
->fields(array('weight' => WEIGHT_VALUE))
->condition('type', 'module')
->condition('name', 'MYMODULE_NAME')
->execute();
@sebcunin
sebcunin / gist:6120095
Last active December 20, 2015 10:59
Création d'un nouveau mode d'affichage pour l'entité Node
<?php
/**
* Implements hook_entity_info_alter().
* @link http://www.wunderkraut.com/blog/drupal-7-custom-node-view-modes/2010-12-20
*/
function MYMODULE_entity_info_alter(&$entity_info) {
$entity_info['node']['view modes']['another_teaser'] = array(
'label' => t('Another teaser'),
'custom settings' => FALSE, // TRUE pour avoir le nouveau d'affichage déjà activé dans l'onglet Custom display settings
);
@sebcunin
sebcunin / gist:6027300
Last active December 19, 2015 22:28
Pour ajouter les apple-icon seulement pour un thème Drupal.
<?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',
@sebcunin
sebcunin / deco-devs.md
Created October 4, 2012 11:24 — forked from ZeeAgency/deco-devs.md
D&Co bureaux devs

Si vous avez des idées, envies particulières, je vous laisse poster les liens vers les articles ici

Budget max : ~50€ par personne, on est 4, bientôt 5 donc ~250€ au total pour notre bureau