Guestbook/comments hardcode into pagetype
I hope someone can help me?
I'm trying to hardcode guestbook/comments into a blog pagetype that I created. I followed these instructions and they don't seem to work:
I don't know if its because there isn't a scrapbook anymore? I copied the comments block to clipboard, but it still doesn't show up hardcoded when I create a new page with that specific pagetype.
Any help would be much appreciated.
$comments = BlockType::getByHandle('autonav'); $comments->controller->requireApproval = 0; $comments->controller->title = 'Comments'; $comments->controller->dateFormat = 'm/d/Y'; $comments->controller->displayGuestBookForm = 1; $comments->controller->displayCaptcha = 0; $comments->controller->authenticationRequired = 0; $comments->controller->notifyEmail = '[email protected]'; $comments->render('view');
Note: Option 2 cannot be done through the CMS, you need to open the PHP file for your Page Type and put this code where you want it to display on the page.
It worked perfectly thank you so much!
Now I just have one more question if you could help me?
I went and changed the view css for guestbook within the concrete/blocks directory.
The changes don't display on the hardcoded guestbook, unless I go and add another guestbook to the same page, then the css changes show, but the moment I delete that extra guestbook again, it goes back to the old look.
I attached pictures to show you.
In guestbook after you can see the css go live if I add another guestbook to the main content area above it.
It works perfectly now!
Your advice and direction has been so helpful!!!