Skip to content

Instantly share code, notes, and snippets.

View sebcunin's full-sized avatar

Sébastien Cunin sebcunin

View GitHub Profile
@sebcunin
sebcunin / Exemple EntityFieldQuery
Created October 25, 2013 07:52
EntityFieldQuery is a class, new to Drupal 7, that allows retrieval of a set of entities based on specified conditions. It allows finding of entities based on entity properties, field values, and other generic entity metadata. The syntax is really compact and easy to follow, as well. And, best of all, it's core Drupal; no additional modules are …
<?php
$query = new EntityFieldQuery();
$query->entityCondition('entity_type', 'node')
->entityCondition('bundle', 'article')
->propertyCondition('status', 1)
->fieldCondition('field_news_types', 'value', 'spotlight', '=')
->fieldCondition('field_photo', 'fid', 'NULL', '!=')
->fieldCondition('field_faculty_tag', 'tid', $value)
->fieldCondition('field_news_publishdate', 'value', $year. '%', 'like')
@sebcunin
sebcunin / metadata
Last active December 25, 2015 12:19
Lire les métas du page
jQuery('meta[name=author]').attr("content");
// Lire le méta Generator
jQuery('meta[name=Generator]').attr("content");
// Lien à utiliser pour visualiser les Open Graph vue par Facebook
// https://developers.facebook.com/tools/debug/
// Visualier le contenu de la OG Description