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!
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!
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.
Makes sense.. too bad though!
I think we can do.
use "on_page_add" event.
use "on_page_add" event.
Or page defaults
On Mar 6, 2011 9:15 AM, "Concrete5 Community" <discussions@concretecms.com>
wrote:
On Mar 6, 2011 9:15 AM, "Concrete5 Community" <discussions@concretecms.com>
wrote: