It would be great if we could drag-and-drop to change the order of the social media icons

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

davidneedham’s picture

I know +1's are a little passé these days, but I'd like to show support for effort on this feature. :-) Thanks Jen!

sylvain lavielle’s picture

Without going so far as drag-and-drop reordering it would be useful to be able to change the order of icons programatically.

I made a patch in order to reorder services using the hook_on_the_web_get_services_alter by defining a weight property for services.

Here the patch and below the code to implement in a custom module ...

function mymodule_on_the_web_get_services_alter(&$services){
  $weights = array('linkedin'=>1,'twitter'=>2,'facebook'=>3,'youtube'=>4);
  foreach($services as $key => &$service){
    if(isset($weights[$key])){
      $service['weight'] = $weights[$key];
    }
  }
}
jenlampton’s picture

I believe you can already adjust the order of the icons by implementing hook_on_the_web_get_services_alter() and simply changing the order of the items in the list right there. I don't think this sort function will be necessary until we add a system for adding weights. I'd like to wait and see if we can get a patch with tabledrag.

  • jenlampton committed 4683ae6 on 7.x-1.x
    Issue #2172957: Add tabledrag reorder ability for icons/services.
    
jenlampton’s picture

Status: Active » Fixed

I just committed a big change that adds the tabledrag reorder ability. Please test on -dev and let me know if you encounter any issues.

Status: Fixed » Closed (fixed)

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