Page 1 of 1

How to integrate facebook comments in a blog (laravel)

Posted: Tue Feb 07, 2017 11:42 am
by gautamz07
Hey guys,

I want to use the comment plugin for my blog --> plugin https://developers.facebook.com/docs/plugins/comments/.

Now how do i associate each comment with a blog post ? i am using laravel, I am not quite sure.

If it were a static site i can just drop the plugin code and BLAM !!

But in my blog i would like the comments to be associated with my blog post , So how do i acheive this ??

Thank you.
Gautam.

Re: How to integrate facebook comments in a blog (laravel)

Posted: Tue Feb 07, 2017 11:57 am
by Celauran
At a glance, it looks like you just need to update the data-href in your fb-comments div, so you could generate that when you render the view.

Re: How to integrate facebook comments in a blog (laravel)

Posted: Tue Feb 07, 2017 1:13 pm
by gautamz07
I'll try it Thanks ! :)

Re: How to integrate facebook comments in a blog (laravel)

Posted: Tue Feb 07, 2017 1:30 pm
by gautamz07
DANM !! worked .. basically just did the following in laravel for it to work::

Code: Select all

<div class="fb-comments" data-href="http://myblog.net/{{ $article->slug }}" data-width="500" data-numposts="5"></div>

Re: How to integrate facebook comments in a blog (laravel)

Posted: Tue Feb 07, 2017 1:40 pm
by Celauran