Facebook Comment box in Single Script
Facebook comment box says 2 things
a) To put script in head
<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/all.js#xfbml=1&appId=XXXXXXXXXXXXXXXXXX";
fjs.parentNode.insertBefore(js, fjs);}(document, 'script',
'facebook-jssdk'));</script>
b) Put up comment to display
<div class="fb-comments" data-href="http://example.com"
data-width="470"></div>
However, it asks for absolute url i.e example.com Also, as per attributes
- it says href - the URL for this Comments plugin. News feed stories on
Facebook will link to this URL. Note: After July 2013 migration, href
should be an absolute URL.
Now we are looking to Integrate script in one go
a) We cant display below head as that will use incorporating using
template - which is used by all sections. Is it like that can it be used
only in 1 section i.e news as a single script
b) URL going to change as its dynamic url and every news will have
different url and thus a unique comment box should show in every url of
news
Url could be:-
example.com/news_n_id=1
example.com/news_n_id=2
example.com/news_n_id=3
Can someone advise on how to implement it effectively as single script
No comments:
Post a Comment