how to pass url variable to addthis:url?

clairetoplis Jun 12, 2012 04:57PM EDT

My site consists of a constantly changing set of flash galleries which are put together using an application that provides an API interface to provide the URL of the currently viewed image in the flash gallery.

I am trying to put the AddThis buttons on each gallery page, but am having trouble finding the right syntax to pass the URL to the buttons.

My third party app provides the image path as follows:

...
$imagepath = 'http://www.mysitename.com' + pathtemp + imageInfo.imageURL;
displayOutput("image path is: " + $imagepath);

(For debug purposes I am displaying the value of $imagepath on my page, and it is correct.)

I am using the following to set the URL for the addthis_toolbox, which isn't working:

<div id="container" class="addthis_toolbox addthis_floating_style addthis_32x32_style" addthis:url='+$imagepath+' style="left:50px;top:50px;">


What syntax do I need to be using?

Many thanks in advance for your help.

Up 0 Rated Down
Paul (AddThis Happiness Specialist) Jun 13, 2012 11:26AM EDT
That syntax should work. Is a specific service having trouble or are you updating the page using AJAX? If you're not sharing the right content to Facebook then you need to make sure you've got the Open Graph tags set properly on the URL you're sharing. If you're using AJAX to update the page you need to run the addthis.toolbox() function to re-render the buttons.

This question is closed to new answers.

Still need help?


General Topics

 

Developers