Hey I've recently attempted to add the function to comment on my current Couch CMS blog but keep getting the "Comments not allowed" error.
The blog is setup is 2 files: blog.php and blog-entry.php. blog-entry.php is Couch CMS cloneable and commentable template with 1 editable richtext field. blog.php lists the blog entries using blog-entry.php as a masterpage and under each entry I have used "<cms:if k_is_commentable >" followed by a simplified Couch CMS commenting form. I've tested the form showing and hiding when I make "commentable='1'" and "commentable='0'" which works good but even when "commentable='1'" and the blog post is set to allow comments in the admin panel by default I cannot comment.
Here is those 2 files for your reference:
blog.php
And here's blog-entry.php:
Appreciate any help of ideas here, I've put a days troubleshooting into it so I'm pretty stumped. Next step is to try and recreate the blog to see where I've gone wrong lol.
The blog is setup is 2 files: blog.php and blog-entry.php. blog-entry.php is Couch CMS cloneable and commentable template with 1 editable richtext field. blog.php lists the blog entries using blog-entry.php as a masterpage and under each entry I have used "<cms:if k_is_commentable >" followed by a simplified Couch CMS commenting form. I've tested the form showing and hiding when I make "commentable='1'" and "commentable='0'" which works good but even when "commentable='1'" and the blog post is set to allow comments in the admin panel by default I cannot comment.
Here is those 2 files for your reference:
blog.php
- Code: Select all
<?php
ob_start();
session_start();
require_once('couch/cms.php');
?>
<cms:template title='Blog' order='60'/>
<!DOCTYPE html>
<html lang='en'>
<head>
<title><cms:get_custom_field 'sitename' masterpage='globals.php' /> - <cms:get_custom_field 'sitetitle' masterpage='globals.php' /></title>
<?php include('incs/head.php'); ?>
</head>
<body id='blog'>
<div class='scroll clickable' id='up'>u</div>
<div id='closemenu' class='clickable hide'>x</div>
<div id='menuoverlay' class='table hide'>
<div class='tablecell'>
<?php include('incs/nav.php'); ?>
</div>
</div>
<a href='/index.php' id='logo'>
<img src='/img/logo.svg'>
</a>
<div class='wrapper'>
<?php include('incs/top.php'); ?>
<div id='contentbox'>
<?php include('incs/header.php'); ?>
<?php include('incs/banner.php'); ?>
<?php include('incs/nav.php'); ?>
<main>
<cms:editable name='blogbody' label='Body text' type='richtext'>
<h1>Blog</h1>
</cms:editable>
<cms:pages masterpage='incs/blog-entry.php' limit='4' paginate='1'>
<div class='panel'>
<h2><cms:show k_page_title/></h2>
<h3><cms:date k_page_date format='jS M, Y'/></h3>
<cms:show blog />
<cms:if k_is_commentable >
<h3>Post a comment</h3>
<cms:form method="post" class="k_form">
<cms:if k_success >
<cms:process_comment />
<cms:if k_process_comment_success>
<cms:send_mail from=k_email_from to=k_email_to subject='Comment posted'>
The following comment has been posted at your site:
<cms:show k_success />
</cms:send_mail>
<div class="k_successmessage">
<p>
Thank you for your comment. Your comment will be published as soon as it's reviewed by the Admin.
</p>
</div>
<cms:else />
<div class="k_errormessage">
<p>
Could not post comment! The following error occured while processing your comment: <cms:show k_process_comment_error />
</p>
</div>
</cms:if>
<cms:else />
<cms:if k_error >
<div class="k_errormessage">
<p>
Could not post comment! The form is incomplete.
</p>
</div>
</cms:if>
<cms:if k_logged_out >
<cms:input type="text" name="k_author" tabindex="1" required="1"/>
<cms:input type="text" name="k_email" tabindex="2" validator="email" required="1"/>
<input type="text" name="k_link" tabindex="3" />
<cms:else />
<p>
Logged in as <b><cms:show k_user_title /></b>.
</p>
</cms:if>
<cms:input type="textarea" name="k_comment" tabindex="4" validator_msg="required=Please enter a comment" required="1" />
<cms:input type="submit" class='clickable' value="Post comment" name="submit"/>
</cms:if>
</cms:form>
</cms:if>
</div>
<cms:paginator simple='1' prev_text='« Newer' next_text='Older »'/>
</cms:pages>
</main>
<div class='clear'></div>
</div>
</div>
<?php include('incs/footer.php'); ?>
</body>
</html>
<?php COUCH::invoke(); ?>
And here's blog-entry.php:
- Code: Select all
<?php
require_once('../couch/cms.php');
?>
<cms:template title='Blog Posts' clonable='1' order='61' commentable='0'>
<cms:editable name='blog' label='Body text' type='richtext'>
<p>
This text is being used as a placeholder for information and images. This text is being used as a placeholder for information and images. This text is being used as a placeholder for information and images.
</p>
</cms:editable>
</cms:template>
<?php COUCH::invoke(); ?>
Appreciate any help of ideas here, I've put a days troubleshooting into it so I'm pretty stumped. Next step is to try and recreate the blog to see where I've gone wrong lol.