Created
September 17, 2013 07:43
-
-
Save tsi/6591195 to your computer and use it in GitHub Desktop.
Drupal implementation of inlineDisqussions
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 | |
/** | |
* Put this in your template.php | |
* Change YOURTHEME to your theme name and YOUR_DISQUS_SHORTNAME to yours. | |
* Implements template_preprocess_page(). | |
*/ | |
function YOURTHEME_preprocess_page(&$variables, $hook) { | |
// inlineDisqussions | |
// This assumes you have a directory named inlineDisqussions in your theme | |
// that contains inlineDisqussions.js and inlineDisqussions.css | |
drupal_add_css(drupal_get_path('theme', 'YOURTHEME') . '/inlineDisqussions/inlineDisqussions.css'); | |
drupal_add_js(drupal_get_path('theme', 'YOURTHEME') . '/inlineDisqussions/inlineDisqussions.js', array('scope' => 'footer')); | |
drupal_add_js('disqus_shortname = "YOUR_DISQUS_SHORTNAME"; | |
jQuery(document).ready(function() { | |
jQuery("p").inlineDisqussions(); | |
});', | |
array('type' => 'inline', 'scope' => 'footer') | |
); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment