Addthis: change description, title and url

I am creating a PHP forum and I want users to be able to share the title and description of each post on facebook, twitter, ... etc. using the Addthis social plugin. Here is the code Addthis gave me:

<!-- AddThis Button BEGIN --> <div class="addthis_toolbox addthis_default_style " addthis:url="www.example.com" addthis:title="Example Title" addthis:description="Example Description"> <a class="addthis_button_preferred_1"></a> <a class="addthis_button_preferred_2"></a> <a class="addthis_button_preferred_3"></a> <a class="addthis_button_preferred_4"></a> <a class="addthis_button_compact"></a> <a class="addthis_counter addthis_bubble_style"></a> </div> <script type="text/javascript" src="http://s6.addthis.com/js/154/addthis_widget.js#pubid=rd-39e8r89e9er8er989"></script> <!-- AddThis Button END --> 

I managed to change the URL to another, which I indicated, but changing the name and description has no effect. In fact, they don’t even appear when I click the Share button and post it on my facebook wall. What is the right way to make this work?

+7
source share
3 answers

AddThis does not officially support all of these parameters, as far as I can tell (I cannot find them all in one place in my documentation), so ideally you should just use the OpenGraph tags on the page where you are located. But anyway...

You need to specify it yourself, and not on the toolbar. You can even specify an image. If your buttons should come from AddThis and not specify them yourself, I'm not sure.

 <div class="addthis_sharing_toolbox"> <a class="addthis_button_facebook" addthis:url="http://google.com/" addthis:title="Here a title" addthis:media="http://images.google.com/example.png" addthis:description="Here a cool description"> <i class="ico ico-facebook"></i> </a> <a class="addthis_button_twitter" addthis:url="http://google.com/" addthis:title="Here a title" addthis:media="http://images.google.com/example.png" addthis:description="Here a cool description"> <i class="ico ico-twitter"></i> </a> <a class="addthis_button_linkedin" addthis:url="http://google.com/" addthis:title="Here a title" addthis:media="http://images.google.com/example.png" addthis:description="Here a cool description"> <i class="ico ico-facebook"></i> </a> </div> 

The AddThis documentation sucks, so I just ran into the right things and figured it out. Enjoy it!

+3
source

AddThis recommends using meta tags from the Open Graph Protocol to indicate what to show.

We strongly recommend the page tagging approach when passing widget parameters to our APIs.

So, in your case, you should have the code lying in the original:

 <!-- AddThis Button BEGIN --> <div class="addthis_toolbox addthis_default_style"> <a class="addthis_button_preferred_1"></a> <a class="addthis_button_preferred_2"></a> <a class="addthis_button_preferred_3"></a> <a class="addthis_button_preferred_4"></a> <a class="addthis_button_compact"></a> <a class="addthis_counter addthis_bubble_style"></a> </div> <script type="text/javascript" src="http://s6.addthis.com/js/154/addthis_widget.js#pubid=rd-39e8r89e9er8er989"></script> <!-- AddThis Button END --> 

and change the title to add addThis meta to your example, for example:

 <meta property="og:url" content="http://www.example.com" /> <meta property="og:title" content="Example Title" /> <meta property="og:description" content="Example Title Description" /> <meta property="og:image" content="http://www.example.com/logo.gif" /> 

This avoids any problem you may encounter in the client API.

+2
source

I went around and went around before finding this on the AddThis website:

Set URL and title for publication

... for our latest tools, use the data and data URL parameters ...

I use their latest code (addthis_sharing_toolbox instead of addthis_toolbox), and all I could find were people who used addthis:url="" , which didn't work.

+2
source

All Articles