Skip to content

Instantly share code, notes, and snippets.

@tsi
Created September 17, 2013 07:43
Show Gist options
  • Save tsi/6591195 to your computer and use it in GitHub Desktop.
Save tsi/6591195 to your computer and use it in GitHub Desktop.
Drupal implementation of inlineDisqussions
<?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