facebook likebox

Have a question or a suggestion about a 3rd party addon module or plugin?
Let us know here.
Post Reply
TheNoiseOfMenno
New Member
New Member
Posts: 4
Joined: Sun May 19, 2013 7:03 pm

facebook likebox

Post by TheNoiseOfMenno »

Hey guys,

on my site http://www.thenoiseofmenno.nl if got some picture albums and i thought it would be cool if people can 'like' the albums on my site. i have looking for a solution or 3 weeks now but i can't find a tutorial or something like that. i'm not a proffesional site builder and this thing is above my level of knowledge.

i have search on google and ended up here https://developers.facebook.com/docs/re ... gins/like/
so i have filled in al the forms and pressed on 'get the code'. and de there were 2 code's on my screen but were do i have to place them in cms made simple? (version= 1.11.6)

This are the codes:

Code 1

Code: Select all

<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/en_GB/all.js#xfbml=1";
  fjs.parentNode.insertBefore(js, fjs);
}(document, 'script', 'facebook-jssdk'));</__script>
Code 2

Code: Select all

<div class="fb-like" data-href="http://www.thenoiseofmenno.nl/index.php?page=sbp-arnhem-2012" data-width="600" data-show-faces="true" data-send="true"></div>
i want to have the like button bar under my photo album.

could somebody help me.
thanks for reading, and i'm sorry for my english...


Menno
TheNoiseOfMenno
User avatar
velden
Dev Team Member
Dev Team Member
Posts: 3497
Joined: Mon Nov 28, 2011 9:29 am

Re: facebook likebox

Post by velden »

Just below the opening body tag in your page template. make sure to add the {litera;}{/literal} tags else you probably will get smart errors:

Code: Select all

<div id="fb-root"></div>
<__script__>

{literal}

(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/en_GB/all.js#xfbml=1";
  fjs.parentNode.insertBefore(js, fjs);
}(document, 'script', 'facebook-jssdk'));

{/literal}

</__script>
Then, in your template, under the album place the second code:

Code: Select all

<div class="fb-like" data-href="http://www.thenoiseofmenno.nl/index.php?page=sbp-arnhem-2012" data-width="600" data-show-faces="true" data-send="true"></div>
PS1. I assume you have a template specifically for the album pages.

PS2. the url of your page should be filled in dynamically. If exists {canonical} would be a good replacement I guess. But there are other alternatives.
Post Reply

Return to “Modules/Add-Ons”