Created
February 3, 2012 18:15
-
-
Save waako/1731493 to your computer and use it in GitHub Desktop.
Drupal, get theme path in javascript
This file contains 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 | |
function theme_preprocess_page(&$variables) { | |
drupal_add_js('jQuery.extend(Drupal.settings, { "pathToTheme": "' . path_to_theme() . '" });', 'inline'); | |
} | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
To use the path, use
Drupal.settings.basePath + Drupal.settings.pathToTheme + <path to whatever you need>