Auto-including guestbook block in template?

Permalink 1 user found helpful
Hello,

I'm working on a custom template for my site, and I would like to auto-include a guestbook on each page. So, in my template where I want to include it, I've tried using the following code:

<?php
$bt = BlockType::getByHandle('guestbook');
$bt->controller->requireApproval = 0;
$bt->controller->title = "Comments:";
$bt->controller->dateFormat = "M jS, Y";
$bt->controller->displayGuestBookForm = 1;
$bt->controller->displayCaptcha = 0;
$bt->controller->authenticationRequired = 0;
$bt->controller->notifyEmail = "";
$bt->render('view');
?>

And this displays a guest book, and it mostly works. You can submit a new comment, however it doesn't show any of the comments that have been made! I'm pretty sure I'm missing a controller setting, but I can't for the life of me figure it out.. Any help would be greatly appreciated, thanks!

 
Mnkras replied on at Permalink Best Answer Reply
Mnkras
i don't think you can do that, it depends upon having a block id, and if you are hard coding it, then it doesn't have one.
FuzzyWuzzy replied on at Permalink Reply
Makes sense.. too bad though!
kino replied on at Permalink Reply
kino
I think we can do.

use "on_page_add" event.
Mnkras replied on at Permalink Reply
Mnkras
Or page defaults
On Mar 6, 2011 9:15 AM, "Concrete5 Community" <discussions@concretecms.com>
wrote: