I've tried to create an embedding function for this but I couldn't figure it out in my allotted time. The JS doesn't seem to be added to the head section using either drupal_set_html_head or drupal_add_js($code, 'inline').

Comments

robloach’s picture

Status: Active » Fixed
  echo theme('sharethis', $title = NULL, $url = NULL);
greenskin’s picture

Unless I'm mistaken, the html head including javascript is already built by the time the theme tpl's are called. So if you are calling theme('sharethis'...) inside of a .tpl file, the javascript will not get added properly. The best thing to do is to add the theme('sharethis'...) output to a variable via template.php then print out that variable in your .tpl.

robloach’s picture

Version: 6.x-1.4 » 6.x-1.x-dev
Status: Fixed » Active

Ahh, I see what you're saying. Why do you want to put this in the theme? Where do you want it to show up? There's probably a module hook we could/should use instead. Adding features into the theme is usually not a good idea because if you want to change themes, you'll be out of luck. It's better to add all new features in the module layer.

nomonstersinme’s picture

i'd, personally, like to be able to reorder it like a cck field.

avpaderno’s picture

Category: Feature request » Support request
Issue summary: View changes
Status: Active » Closed (outdated)

I am closing this bug report, as Drupal 6 is no longer supported. Please re-open it if the issue is still relevant for the Drupal 7 or 8 version of the module.