Skip to content

Instantly share code, notes, and snippets.

@jamiemagique
Created March 11, 2015 10:47
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jamiemagique/56963b2b71d68b728bb1 to your computer and use it in GitHub Desktop.
Save jamiemagique/56963b2b71d68b728bb1 to your computer and use it in GitHub Desktop.
yepnope() test example
yepnope([{
test: $('.CLASSNAME').length !== 0,
yep: Drupal.settings.basePath + Drupal.settings.pintSettings.pathToTheme + '/js/vendor/YES-FILENAME.js',
nope: Drupal.settings.basePath + Drupal.settings.pintSettings.pathToTheme + '/js/vendor/NOPE-FILENAME.js',
}]);
function THEMENAME_preprocess_page(&$variables) {
// Add custom settings
drupal_add_js(array(
'customThemeSettings' => array(
'pathToTheme' => path_to_theme()
)
), 'setting');
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment