PHP Developers Network

A community of PHP developers offering assistance, advice, discussion, and friendship.
 
Loading
It is currently Wed Jun 28, 2017 10:39 am

All times are UTC - 5 hours




Post new topic Reply to topic  [ 5 posts ] 
Author Message
PostPosted: Tue Feb 07, 2017 12:42 pm 
Offline
Forum Contributor
User avatar

Joined: Wed May 14, 2014 12:18 pm
Posts: 319
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.


Top
 Profile  
 
PostPosted: Tue Feb 07, 2017 12:57 pm 
Offline
Moderator
User avatar

Joined: Tue Nov 09, 2010 3:39 pm
Posts: 6249
Location: Montreal, Canada
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.

_________________
Supported PHP versions No longer supported versions


Top
 Profile  
 
PostPosted: Tue Feb 07, 2017 2:13 pm 
Offline
Forum Contributor
User avatar

Joined: Wed May 14, 2014 12:18 pm
Posts: 319
I'll try it Thanks ! :)


Top
 Profile  
 
PostPosted: Tue Feb 07, 2017 2:30 pm 
Offline
Forum Contributor
User avatar

Joined: Wed May 14, 2014 12:18 pm
Posts: 319
DANM !! worked .. basically just did the following in laravel for it to work::

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


Top
 Profile  
 
PostPosted: Tue Feb 07, 2017 2:40 pm 
Offline
Moderator
User avatar

Joined: Tue Nov 09, 2010 3:39 pm
Posts: 6249
Location: Montreal, Canada
Don't hardcode the URL.

https://laravel.com/docs/5.4/helpers#method-route
https://laravel.com/docs/5.4/helpers#method-url

_________________
Supported PHP versions No longer supported versions


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 5 posts ] 

All times are UTC - 5 hours


Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Jump to:  
Powered by phpBB® Forum Software © phpBB Group