Problem/Motivation

There is a conflict now with using the class addthis_button_[service]. You can't add this bubble style now. Because service names are added dynamicly to addthis_button you would have a problem when you want to add the bubble style as a decorated link in the toolbox.

Proposed resolution

Add extra validation for specific alternate service names.

Remaining tasks

Review.

User interface changes

API changes

Original report by @matglas86

There is a conflict now with using the class addthis_button_[service]. You can't add this bubble style now. Because service names are added dynamicly to addthis_button you would have a problem when you want to add the bubble style as a decorated link in the toolbox.

CommentFileSizeAuthor
#5 1348502-4.patch2.7 KBmatglas86
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

mortona2k’s picture

Any progress?

tjerkdekuijper’s picture

Try the following, works for me. Had no time to build a patch.
in addthis.displays.addthis.inc line number 37 change this:

    $items[$service] = array(
      '#theme' => 'addthis_element',
      '#tag' => 'a',
      '#value' => '',
      '#attributes' => array(
        'href' => $addthis->getBaseBookmarkUrl(),
        'class' => array(
          'addthis_button_' . $service,
        ),
      ),
      '#addthis_service' => $service,
    );

into this:

    $items[$service] = array(
      '#theme' => 'addthis_element',
      '#tag' => 'a',
      '#value' => '',
      '#attributes' => array(
        'href' => $addthis->getBaseBookmarkUrl(),
        'class' => array(
          'addthis_button_' . $service,
        ),
      ),
      '#addthis_service' => $service,
    );

	$addthis_counter = array(
	  '#theme' => 'addthis_element',
	  '#tag' => 'a',
	  '#value' => '',
	  '#attributes' => array(
		'href' => '',
		'class' => array(
		  'addthis_counter addthis_bubble_style',
		),
	  ),
	);
	
	if($service == 'addthis') {
	  array_push($items, $addthis_counter);
	}
tjerkdekuijper’s picture

Even better, as of version 7.x-4.x you can use use HOOK__addthis_markup_alter to this. See example below:

function YOURMODULE_addthis_markup_alter(&$markup) {
  if (isset($markup['addthis'])) {
	$markup['counter'] = array(
	  '#theme' => 'addthis_element',
	  '#tag' => 'a',
	  '#value' => '',
	  '#attributes' => array(
		'class' => array('addthis_counter', 'addthis_bubble_style'),
	  ),
	);
  }
}

  • Commit 93a483a on 7.x-4.x by matglas86:
    Changes for #1348502: Adding bubble and pill style.
    
matglas86’s picture

Assigned: Unassigned » matglas86
Issue summary: View changes
Status: Active » Needs review
FileSize
2.7 KB

I already merged this into development but can change it if neccesary.
Please test the styles added. bubble_style and pill_style.

Commit 93a48

matglas86’s picture

Assigned: matglas86 » Unassigned
Status: Needs review » Fixed

I'm going to put it fixed. If problems come up. Let me know.

Status: Fixed » Closed (fixed)

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