4

I've run into a dilemma with Drupal and SSL.

I'm utilising the Disqus module, however, Drupal loads the Disqus .js files on all pages including the cart and checkout addresses. This would be fine except that it includes non-secure paths to external JS files that contain more non-secure paths, which means that browsers show SSL errors.

I'm trying to find some way to just exclude these .js files on particular paths. I've seen information on excluding files entirely or including them, but not just from these path's.

Any help would be greatly appreciated, thanks!

2 Answers 2

2

I think that this module spits out the reference to the JS file inline in the content. If this is true, then I would use some logic inside template_preprocess_page to determine whether you are on an HTTPS path, and then search/replace $vars["content"] and remove the string. You may also be able to use template_preprocess_comment_wrapper to do the same thing.

This solution is pretty hackish, but I think it may be your only solution short of patching the module.

1

You can utilize hook_preprocess_page like in this thread.
But i'm not sure if drupal_add_js works with external js in D6. Check out this thread if it doesn't.

1
  • 1
    drupal_add_js doesn't work with external js in D6 as you suspected, but you can use drupal_set_html_head instead.
    – wildpeaks
    Commented Jun 23, 2011 at 20:00

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.