This site has been archived. To learn more about our current products Ibexa Content, Ibexa Experience, Ibexa Commerce head over to the Ibexa Developer Portal

eZ Community » Forums » Developer » How to implement facebook Like it...
expandshrink

How to implement facebook Like it button in EzPublish 4.0.1

How to implement facebook Like it button in EzPublish 4.0.1

Tuesday 24 September 2013 11:31:31 am - 4 replies

Hello,

I'm new in EzPublish and i'm propably more than green with writting code in any language so please help me.

I have found some related topics but cant make it work for me.

I tried to use methods described in this post http://share.ez.no/blogs/thiago-campos-viana/tip-facebook-like-button/(language)/eng-GB

But i dont know where to put that code? I have found template used for my website. I put there {include ..} form but it dosnt show any thing. 

 

I also tried to use tips from http://share.ez.no/forums/setup-design/how-to-add-facebook-s-xfbml-like-button-to-content-within-a-page/(language)/eng-GB

I have make class as it was mentioned in this post but i dont know how to use it. I created object with code that i get form facebook site http://developers.facebook.com/docs/reference/plugins/like/.

But after post it on my web site I get only text, not Like it button.

Please help.

Best regards 

Lombarski Sebastian

Sunday 29 September 2013 10:23:20 pm

Hi Sebastian,
You can insert your code in any template file, depending on where you want your "like button" to be displayed. 

Lets say for example that you want to display your "like button" on the top of your website, then you could insert the code in: extensions/myExtension/design/myExtension/templates/page_header.tpl

This file should be an override of the template: extensions/ezwebin/design/ezwebin/templates/page_header.tpl

Note that this is just an example, and that the template in which you should insert your code depends on where you want to place you "like button". But you must always take in consideration the template overrides.

Here is an example of the code that should be placed:

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

{literal}<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>

{/literal}<div class="fb-like" data-send="true" data-layout="box_count" data-width="450" data-show-faces="false" data-font="trebuchet ms" data-colorscheme="dark"></div>

 

Regarding the tips from http://share.ez.no/forums/setup-design/how-to-add-facebook-s-xfbml-like-button-to-content-within-a-page/%28language%29/eng-GB,, as I understoud this is for a specific case, where the '"like button" should be placed in a specific page after some content that was inserted from the admin interface. So, if this is not your case, you don't have to wory about creating costum classes...

Monday 30 September 2013 1:22:59 pm

Hello Fátima,

Thx for your reply, it helped me greatlyhappy.gif Emoticon
In the end i did new template with content that you mentioned above, changing only language settings and website href.
I have implemented it using {include uri="design:fb_temaplate.tpl"} formula by putting it in place where it was need in my pagelayout.tpl.

Once again thxhappy.gif Emoticon

Best regards

Sebastian Lombarski

Monday 30 September 2013 2:15:02 pm

Great to hear that you solved your problem Sebastian!

Tuesday 22 October 2013 3:20:17 pm

Thanks for sharing this.. It's really good for those who are working behind Facebook App Development

expandshrink

You must be logged in to post messages in this topic!

36 542 Users on board!

Forums menu

Proudly Developed with from