Problems, need help? Have a tip or advice? Post it here.
5 posts Page 1 of 1
The problem is that I can't use native commenting system. A template is controlled by custom routes and I think that it may be incompatible with comments. The variable "k_is_commentable" gets set because I can see a comment form but when I click submit button it says:

Could not post comment!
The following error occured while processing your comment:
Page not commentable

source:
Code: Select all
   <cms:if k_matched_route='page_view' >
      <cms:pages page_name="<cms:show rt_page_name />" >
         <cms:if k_is_commentable >
            <div>
              <cms:form method="post" >
                <cms:if k_success >
                    <cms:process_comment />
                    <cms:if k_process_comment_success>
                        <div class="k_successmessage">
                          <p>
                            Thank you for the feed back! <br>
                            Your comment awaits moderation and will be published as soon as reviewed by the Admin.
                          </p>
                        </div>
                      <cms:else />
                        <div class="k_errormessage">
                          <p>
                            Could not post comment! <br>
                            The following error occured while processing your comment:<br>
                            <cms:show k_process_comment_error />
                          </p>
                        </div>
                    </cms:if>
                  <cms:else />
                    <cms:if k_error >
                      <div class="k_errormessage">
                        <h2>Fields incomplete!</h2>
                        <ul>
                          <cms:each k_error >
                            <li><cms:show item /></li>
                          </cms:each>
                        </ul>
                      </div>
                    </cms:if>
                    <p class="comment-input">
                      <cms:input type="text" name="k_author" size="22" tabindex="1" required="1"/>
                      <label for="author"><small>Name *</small></label>
                    </p>
                    <p class="comment-input">
                      <cms:input type="textarea" name="k_comment" style="width:93%" rows="10" cols="10" tabindex="4"
                          validator_msg="required=Please enter something as comment"
                          required="1" />
                    </p>
                    <p class="comment-input">
                      <label for="captcha"><small>Please enter this word in the textbox below</small></label><br>
                      <cms:input type="captcha" name="captcha" format='i-r-t' />
                    </p>
                    <cms:input type="submit" value="Submit" name="submit"/>
                </cms:if>
              </cms:form>
            </div>
          </cms:if>
      </cms:pages>
  </cms:if>
Following instructions found in the topic: viewtopic.php?f=4&t=9147&p=23792&hilit=Page+not+commentable#p23792
i've managed to get commenting working but there is a problem. It does not redirect to the same page as the commenting system leads to NOT custom route but a usual one
My last question on the topic. It seems that I can mimic native commenting system with a usage of DataBound Forms and custom admin views. Can there be any problems with such an approach? If amount of comments would be high can there be any website slowdowns comparing with the native commenting?
Hi, you'll definitely see a speed boost instead. If comments are in a separate template as cloned pages, then it's very efficient to use cms:pages and cms:related_pages queries instead of default comment queries. I'm not saying that default commenting is not optimized, I didn't test it that much, but I'm saying that the alternative solution is much more customizable, efficient and future-proof. It also can support replies to comments :)
Join COUCH:TALK channel here https://t.me/couchcms_chat
Ryazania — a framework to boost productivity with Add-ons viewtopic.php?f=2&t=13475
Support my efforts to help the community https://boosty.to/trendo/donate
trendoman wrote: Hi, you'll definitely see a speed boost instead. If comments are in a separate template as cloned pages, then it's very efficient to use cms:pages and cms:related_pages queries instead of default comment queries. I'm not saying that default commenting is not optimized, I didn't test it that much, but I'm saying that the alternative solution is much more customizable, efficient and future-proof. It also can support replies to comments :)


Thank you!
5 posts Page 1 of 1