I should add an on_the_web.api.php file that documents use of hook_on_the_web_get_services_alter().

Here's a good example:

/**
 * Implements hook_on_the_web_get_services_alter().
 * Puts facebook at the very front of the list of icons.
 */
function mymodule_on_the_web_get_services_alter(&$services) {
  // Pull out facebook.
  $face = $services['facebook'];
  // Remove facebook.
  unset($services['facebook']);
  // Put facebook at the begining.
  $services = array('facebook' => $face)+$services;
}

Comments

jenlampton’s picture

Issue summary: View changes
davidneedham’s picture

I'm curious to see what else can be done with the API. Is there a way to manually add additional services? Obviously a simple hook wouldn't work...

In the meantime I've put my service url into an option I'm not using and using this great tip to change the name and image replace the link.

jenlampton’s picture

@davidneedham yes, you should be able to add an additional service the same way you modified the unused one. You may also need to override theme_on_the_web_image() to specify the location of the icon you want to use if you aren't putting it into the same directory as all the others, but it should work in the same way.

jenlampton’s picture

Status: Active » Fixed

I just added an on_the_web.api.php file for documentation purposes.

  • jenlampton committed f05468c on 7.x-1.x
    Issue #2172959: Add an api.php file for documenting the alter hook.
    

Status: Fixed » Closed (fixed)

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