How to Customise ShareThis Settings – ShareThis

Hey everyone,

I’ve just added ShareThis to a website I’m currently working on. It’s basically a generator for all your typical social network plugins (Facebook Like, Twitter Share, Google+ etc). The main advantage I’ve found with using it is the detailed analytics.

While I haven’t had any major issues, there were a few customisations I had to make:

Change Title in ShareThis
Changing the title is pretty easy, simply use the st_title attribute:



Change/Set the URL that is Shared
I needed to set this when generating content via ajax to ensure that the correct URL was shared. Again, it’s pretty straight forward – just use the st_url attribute.



Re-initialising ShareThis buttons when using ajax
A follow on from the last issue is that ShareThis buttons will need to be reinitialised if additional content is generated via ajax:

//Re-initialise ShareThis
if (stButtons){
     stButtons.locateElements();
}

There’s a bit more info here, via this StackOverflow post:


Posted

in

,

by

Comments

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

Create a website or blog at WordPress.com

%d bloggers like this: