Facebook comments on every page

microdigital

Avatar: microdigital

2012-05-21 09:13

You can add a Facebook comments widget simply by putting this code:

<br />&nbsp;<br />
<div id="fb-root"></div>
<script src="http://connect.facebook.net/en_US/all.js#appId=xxxxxxxxxxxxxxx&amp;xfbml=1"></script>
<fb:comments href="http://www.your-site.com$_SERVER['REQUEST_URI']" num_posts="5" width="450"></fb:comments>

inside file templates/default/pages_default.tpl, between:
<!-- here is content from SUBPAGES_DEFAULT or other SUBPGAGES_xx blocks -->

<!-- here you put the code -->

</div>
<!-- END CONTAINER -->

The solution provided solves the common problem of the same Facebook comments on all pages - that means that every page has its own comments.

You can see the widget in action:
http://www.stomatologie-bucuresti.info/

» Quick.Cms v4.x

http://www.stomatologie-bucuresti.info/

microdigital

Avatar: microdigital

2012-05-21 10:18

[UPDATE]

You can control which pages can have Facebook comments.
Just make a copy of templates/default/pages_default.tpl and name it pages_default_FBcomments.tpl
All you have to do is, when creating new pages (or modifying existing ones), set "Template" option from "View" tab to pages_default_FBcomments.tpl. That way, only these pages will show the Facebook comments widget.

http://www.stomatologie-bucuresti.info/

Back to top
about us | contact