You are here

function hook_service_links_node_settings_alter in Service links 7.2

Allows alteration of the service link settings for a given node.

Parameters

array $settings: Reference to the array of service link settings for a node.

node: The fully loaded node object that the settings correspond to.

See also

drupal_alter();

_service_links_get_tags();

1 invocation of hook_service_links_node_settings_alter()
_service_links_get_tags in ./service_links.module
Fill an array with tags and the content to substitute.

File

./service_links.api.php, line 97
Provides documentation for the Service Links API.

Code

function hook_service_links_node_settings_alter(&$settings, $node) {

  // Use a site-specific URL shortener.
  $short_url = "http://example.com/{$node->nid}";
  $settings['subst']['short-url'] = $short_url;
  $settings['subst']['encoded-short-url'] = urlencode($short_url);
  $settings['subst']['raw-encoded-short-url'] = urlencode($short_url);

  // Hide a specific service on nodes of a specific type.
  if ($node->type == 'notweets') {
    unset($settings['link_show']['twitter']);
  }
}