2

Trying to add share buttons to output something like:

{{region}} text {{region_variable}} text www.google.com

The below works very intermittently for Twitter, but when I share the URL, the map won't load.

<a href="https://twitter.com/share" target="_blank" class="twitter-share-button" data-url="http://www.google.com" data-text="{{region}} text {{region_variable}} text" data-count="none">Tweet</a>
<script>!function(d,s,id){var js,fjs=d.getElementsByTagName(s)[0],p=/^http:/.test(d.location)?'http':'https';if(!d.getElementById(id)){js=d.createElement(s);js.id=id;js.src=p+'://platform.twitter.com/widgets.js';fjs.parentNode.insertBefore(js,fjs);}}(document, 'script', 'twitter-wjs');</script>

Not even sure where to start with doing the same with Facebook.

3

For the moment CartoDB do not support javascript in infowindow templates. In the meantime you can take a look to this blogpost:

http://blog.cartodb.com/introducing-social-infowindows-display-your-tweets-the/

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.