i suppose the way this works is that it just passes the url from node pages to the various services (digg/blogger/etc) so does this work on non-node pages by just calling a service links theme function? i would like to add this to my mls listing pages which aren't nodes but have a distinct url, i dont know yet if this would work with that or not.

Comments

TheCrow’s picture

i think it could work: for generate the item list just call service_links_render passing NULL as node object, and use one of theme functions availables (or write another one using the item returned by the render function) printing the result inside a block or wherever you need.

drupalninja99’s picture

sounds good i will try that

drupalninja99’s picture

works good, I guess all it needs in the node param is something resembling a node with a title

just added <?=theme('links', service_links_render($node, TRUE))//add digg, facebook, etc links?>

TheCrow’s picture

i think drupal_get_title() can be useful; in service_links_render() change the code:

$title = urlencode($node->title);

with:

if (!isset($node->title)) {
  $node->title = drupal_get_title();
}
$title = urlencode($node->title);

otherwise change this:

  else {
    $url = url($_GET['q'], NULL, NULL, TRUE);
  }

with:

  else {
    $url = url($_GET['q'], NULL, NULL, TRUE);
    $node->title = drupal_get_title();
  }
TheCrow’s picture

Status: Active » Fixed

Committed the second solution in the dev. version

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.

webservant316’s picture

Issue summary: View changes

How does this work for 7.x?
https://www.drupal.org/node/2328081