Adding Facebook plugin comments for dynamic products
i want to add facebook plugin comments box for each item i have in my database开发者_运维百科 to show it in the item page . and want also the created item has facebook plugin comments.
if anyone know how please share it?
Thanks
I know this response is coming rather late, but once you have an app ID from Facebook, add a simple meta tag to your master page, template page, etc.:
<meta property="fb:app_id" content="..." />
and then add the comments plugin to your items page template:
<fb:comments id="comments-box" href="..." num_posts="5"></fb:comments>
You then need to set the href="..."
value to the unique URL of each item page. If you're using Razor syntax, it could be as simple as href="@Request.Url.AbsoluteUri"
so long as you can guarantee that for each page, the URL is always exactly the same, i.e., any variation is query string parameters, etc. could have unwanted/unexpected results.
You should be able to include the comments plugin on each page without doing anything special, documentation at https://developers.facebook.com/docs/reference/plugins/comments/, there's also a special fb:comments-count tag you can use to output the number of comments for a given URL
精彩评论