How to integrate facebook comments in a blog (laravel)

Discussion for various published PHP frameworks, including Zend Framework, CodeIgniter, Kohana, CakePHP, Yii, Symfony, and others.

Moderator: General Moderators

Post Reply
User avatar
gautamz07
Forum Contributor
Posts: 331
Joined: Wed May 14, 2014 12:18 pm

How to integrate facebook comments in a blog (laravel)

Post 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.
User avatar
Celauran
Moderator
Posts: 6425
Joined: Tue Nov 09, 2010 2:39 pm
Location: Montreal, Canada

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

Post 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.
User avatar
gautamz07
Forum Contributor
Posts: 331
Joined: Wed May 14, 2014 12:18 pm

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

Post by gautamz07 »

I'll try it Thanks ! :)
User avatar
gautamz07
Forum Contributor
Posts: 331
Joined: Wed May 14, 2014 12:18 pm

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

Post 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>
Post Reply