I am using the Sky Theme and I would like to have the ShareThis icon look the same as my other Add New omment and Read More icons. So basically it will look like it does on your screenshot verses the standard ShareThis Icon. Your help is well appreciated.

Comments

himerus’s picture

Assigned: Unassigned » himerus
Status: Active » Closed (fixed)

This can be accomplished using CSS. The ShareThis icon is sent by the STAPI code. You can investigate the CSS being presented by the API, and adjust it accordingly to match your theme.

leanazulyoro’s picture

Category: feature » support
Priority: Normal » Minor

This should not be managed with css, you CAN through the STAPI change the look of the sharethis icon, I've done it myself when using STAPI alone, not through this module. I used the code given by Sharethis in the head and this code where I want my custom icon:

<script language="javascript" type="text/javascript">
				//Create your sharelet with desired properties and set button element to false
				var object = SHARETHIS.addEntry({
				title:'share',
				summary: 'Sharing is good for the soul.'},
				{button:false});
				//Output your customized button
				document.write('<span id="share"><a title="Share this" href="javascript:void(0);" ><img src="http://www.example.com/images/share_icon.png" /></a></span>');
				//Tie customized button to ShareThis button functionality.
				var element = document.getElementById("share");
				object.attachButton(element);
				</script> 

But this code does not work if I use it in the "Share This Code" textfield that the module provides in its configuration options. It SHOULD but it doesn't. no matter if I use the "button: false" statement, it always displays the default icon.

So unless there is a way to do this that you'd like to share, I'm making this a feature request.

leanazulyoro’s picture

Priority: Minor » Normal
Status: Closed (fixed) » Active
leanazulyoro’s picture

Category: support » feature
BigEd’s picture

Category: support » feature
Priority: Minor » Normal

Has anyone worked a solution for this yet?

If so could you post in here as I have tried several things from adding the script into the page.tpl file and tried to remove it using css and have got pretty close. But I still have been unable to remove just the icon and leave the link text.

Any pointers would be greatly appreciative.

Thx

robloach’s picture

Title: Change ShareThis Icon to Default Theme Icons » Change ShareThis Icons
Version: 6.x-1.2-1 » 6.x-1.x-dev
Assigned: himerus » Unassigned
Status: Active » Needs work
robloach’s picture

You can change it with CSS:

body .stico_rotate { /* Or whatever the class is for the icon */
  background: transparent url(http://example.com/example.png) no-repeat scroll 0 0 !important;
}
robloach’s picture

Status: Needs work » Closed (works as designed)
alexkb’s picture

Rob, The css that you set in your theme to override the css that's included by the sharethis service is also set to !important, so that has no effect.

It's a real shame that this module can't do what the module screenshot demonstrates (with no sharethis icon).

alexkb’s picture

Ok, I seem to have been able to accomplish the effect demonstrated in the screenshot, by using the Node->Sharethis link field in views. Thanks!

My mistake, I had the style class set wrong, that's why it showed correctly (without the image) but then the sharethis popup didn't work.

Looking at the dev version of sharethis, and service_links, it looks like it provides options not to show the icon, but the downside is, service_links is currently under heavy development, and it doesn't appear to have views integration.

adamdicarlo’s picture

Status: Closed (works as designed) » Active

Making a CSS background image go *over* an image tag is a really dirty hack. Especially considering that the ShareThis API supports using <span class="st_sharethis_custom"></span> in order to allow CSS to set the button icons via a background image. See http://help.sharethis.com/customization/custom-buttons.

But the module doesn't allow setting that class, and it doesn't have any decent drupal_alter() openings or theme functions to allow custom code to tweak the span tag attributes.

Couldn't "Custom buttons via CSS" be an option under "Choose button style" on the admin page?

adamdicarlo’s picture

Version: 6.x-1.x-dev » 7.x-2.x-dev
Status: Active » Needs review
StatusFileSize
new1.51 KB

Here's a patch for 7.x-2.x to allow this.

adamdicarlo’s picture

Sigh. No, that patch doesn't work right. ShareThis expects you to insert an image tag within the span when using that class. Sigh. This is a major pain....

jhedstrom’s picture

StatusFileSize
new996 bytes

I was able to get custom icons working using a simpler patch, and custom CSS.

.st_sharethis_custom {
  display: block;
  ...
}
jhedstrom’s picture

StatusFileSize
new594 bytes

Oops, that last one had .info file information in it.

Jason Dean’s picture

#15 gave me a span with class 'st_sharethis_custom', but the span is empty.

If I change the config back to horizontal counters, I get a span with class 'st_sharethis_hcount' with further markup and code inside (and the default button displays fine).

I wonder what I'm missing here?

crosshairs’s picture

StatusFileSize
new177.56 KB

Thanks for the patch from #15, worked great for me!

@pushka, once you have the custom class, you need to include all the css from the 'missing' nested span tags that were there before, in order to get the new images to display correctly.

eg adding the the following css didn't work:

.st_twitter_custom {
    background-image: url("images/twitter-bw.png");
}

Adding this css does work:

/* custom sharethis icons */
.sharethis-wrapper .st_twitter_custom {
	display:inline-block;
	background-image:url("images/twitter-bw.png");
	background-repeat:no-repeat;
	font-family:Helvetica,sans-serif;
	font-size:11px;
	height:16px;
	line-height:16px;
	padding-left:20px;
	padding-right:3px;
	white-space:nowrap;
	cursor:pointer;
}

Here's a screenshot (sharethis_firebug.png) of my page in Firebug showing the css from the nested span tags before applying the patch. This is what you need to add in the custom class css.

Hope this helps!

ps For some reason it's fussy and doesn't like spaces between the css properties and values. eg use
display:[NO-SPACE-HERE]inline-block;

crosshairs’s picture

I'm guessing it's not possible to customise the Facebook 'Like' button image?
Inspecting the code I see the whole thing's not actually an image, it's all done in css.

Jason Dean’s picture

hey this is really helpful. Thanks so much! :)

robloach’s picture

Status: Needs review » Fixed

Status: Fixed » Closed (fixed)

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

ruthverena75’s picture

does anybody have an idea how i can get a sharethis button with a custom icon AND a horizontal counter?

sillo’s picture

Hi. i tried your module patch, i got an option named "Custom buttons with CSS" , when i use your patch setting , it does not show how many shared , the counter disappears when i use your patch.

Could you please make a patch where you dont remove the counter? i like the horizontal layout with counter.

Thank you very much.

darktek’s picture

@RobLoach Man you just saved my life thx so much !