Category Archives: Web

Sandvox and the Facebook like button

Adding a sharing bar in Sandvox is simple but for some reason, when doing so for my music page it didn’t work getting the Facebook like button to show up. All the other buttons did, but not that one (and I do have a valid App-ID).

After a lot trying and failing I tried to simply make a ”Like” button using the Facebook tools: https://developers.facebook.com/docs/plugins/like-button/

 

Paste this (or rather what the above mentioned site suggests) after your body tag with code injection and it all just works 🙂

<div id="fb-root"></div><script>(function(d, s, id) {  
var js, fjs = d.getElementsByTagName(s)[0];  
if (d.getElementById(id)) return;  
js = d.createElement(s); 
js.id = id;  js.src = "//connect.facebook.net/sv_SE/all.js#xfbml=1&appId=YOUR-APPID-HERE";
fjs.parentNode.insertBefore(js, fjs);}(document, 'script', 'facebook-jssdk'));
</script>

 I don’t know why I needed to do this. Might be a bug in Sandvox, or just me doing something wrong. Anyway. This solved the problem..