How to integrate Facebook comments into dynamic template

I added the script under Custom Code of the entire site.

<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_US/sdk.js#xfbml=1&version=v2.5";
  fjs.parentNode.insertBefore(js, fjs);
}(document, 'script', 'facebook-jssdk'));</script>

Edit: I also assigned some custom attributes to the Div (found by scrolling to the bottom of the right menu).

It looks like every single FB comment widget depends on site url. and since there is everywhere same url in data-href it keeps showing same comments everywhere.

I would try do remove data-href atribute and look how it works

Awesome I will try this.

Also… great test comment :wink:

2 Likes

^^^ I just laughed so hard at this hahaha. Glad you all were able to find a solution :smiley: @sabanna did you use this? http://lorizzle.nl/ haha

Yes, exactly this one.
I am not sure that solution will work yet :confused: But really hope

1 Like

At least some fun along with the problem :wink:

I am trying it right now. Will report back.

1 Like

Yikes so it broke it without the data-href: http://wishdish.webflow.io/blog/new-blog-post-to-test-a-lot-5

As you can see on this example article the comments flash a red error message, then disappear. I think I might need to generate a data-href link for every single page, no?

I wish I could set the data-href to some $link (this pulling in the current site’s link), but unfortunately I don’t think that is possible in Webflow.

I am exporting the site, though, so this could be the last thing I do outside of Webflow.

Christopher

Pity :frowning:

Why you did not try Disqus comments?

Client wants Facebook comments for growth reasons (whenever someone comments, it shows on your Facebook Wall). I had Disquis initially and they requested Facebook comments explicitly for this reason.

I will just manually make the change outside of Webflow when I export the code.

But CMS site will be exported without dynamic data

These are all fake stories, users, and image. Unless of course you’re telling me that the entire framework for CMS gets lost upon export? :neutral_face:

It will loose CMS and dynamic functionality because it will be disconnected from database

Hmm I see. The client is paying someone else to port it to Wordpress and also has a backend guy who will be hooking it all up so hopefully this won’t be an issue. My task is to build the frontend, and I have built it using lots of the CMS elements offered by Webflow.

Could someone from Webflow shed some more light on the reality of exporting CMS? What exactly stays, and what goes?

Christopher

go to this thread here it explains a great way to go from webflow to wordpress:
http://forum.webflow.com/t/webflow-export-to-wordpress-from-scratch/10169

I’m going to attempt to get fb comments on my different pages too.

1 Like

Hey guys, just wanted to post an updated on this - due to our recent Dynamic Embed Code feature, it is now possible to integrate Facebook Comments :slight_smile:

Take a peek here for an example: http://facebook-comments.webflow.io/dynamic-template-with-facebook-comments/test-page

Use the preview link to see how it is done: https://preview.webflow.com/preview/facebook-comments?preview=80895b186414dcf9b74e0e92b3bcb094

If you have any trouble, just shoot me a DM - happy to help!

6 Likes

Hey @thewonglv, I just checked out your link to the preview link and example link.
EXEMPLE LINK works perfectly. But when I am on the USE PREVIEW I can’t see anything. Nothing shows up, even on preview mode. Am I missing something? Is there a link that can help me with this?

thanks a lot!!

1 Like

Same here. I wanted to see how it’s done as well and all I get is a blank page.

Hi!

grtzz

1 Like

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.