<?php require_once 'app/init.php'; ?> <?php echo View::make('header')->render() ?> <h3 class="page-header">Comment Page Example</h3> <?php $page = '1'; // Page identifier $pageTitle = 'My Page'; // Friendly name for the page echo ajax_comments($page, $pageTitle); ?> <?php echo View::make('footer')->render() ?>
ajax_comments function will display the HTMl for the comments. The first parameter
$page is an identifier, so for each page you have diferrent comments. The second one
$pageTitle should be set to a name that represents that page, so you can see easily in the admin panel on which page was the comment posted.
<html> <head> <!-- Include jQuery --> <script src="assets/js/vendor/jquery-1.11.1.min.js"></script> </head> <body> <!-- Embeded version with iframe --> <div id="embed_comments" style="max-width:800px"></div> <script src="assets/js/embed-comments.js"></script> <script> embedComments('#embed_comments', '1', 'My Page'); </script> <!-- /end --> </body> </html>
embedComments function takes 3 parameters. The first one is a selector (id/class) of the div where you want the comments to be displayed (in this case
The second one is an identifier, so for each page you have diferrent comments.
The third one should be set to a name that represents that page, so you can see easily in the admin panel on which page was the comment posted.
For a complete example that includes the log in and sign up see
extra/examples/modal/comments.php from the archive.