Last active
August 29, 2015 14:13
-
-
Save ccamara/2fbf81ddf11c91c2190f to your computer and use it in GitHub Desktop.
Insert an external library to your drupal7 theme #mmenu
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 | |
/** | |
* @file | |
* Contains the theme's functions to manipulate Drupal's default markup. | |
* | |
* Complete documentation for this file is available online. | |
* @see https://drupal.org/node/1728096 | |
*/ | |
function yourtheme_preprocess_html(&$variables, $hook) { | |
drupal_add_library('yourmodule', 'mmenu'); | |
drupal_add_js(drupal_get_path('theme', 'yourtheme') . '/js/mainmenu-responsive.js', 'file'); | |
} |
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 | |
/** | |
* Implements hook_library(). | |
*/ | |
function yourmodule_library() { | |
// Declares mmenu library. | |
$libraries['mmenu'] = array( | |
'title' => 'mmenu', | |
'website' => 'http://mmenu.frebsite.nl', | |
'version' => '4.5', | |
'js' => array( | |
libraries_get_path('mmenu') . '/src/js/jquery.mmenu.min.js' => array(), | |
), | |
'css' => array( | |
libraries_get_path('mmenu') . '/src/css/jquery.mmenu.css' => array( | |
'type' => 'file', | |
'media' => 'screen', | |
), | |
), | |
); | |
return $libraries; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment