ExpressionEngine CMS
Open, Free, Amazing

Thread

This is an archived forum and the content is probably no longer relevant, but is provided here for posterity.

The active forums are here.

Comment Form Not Displaying. Problem with {exp:comment:form} tag?

January 10, 2011 8:26am

Subscribe [3]
  • #1 / Jan 10, 2011 8:26am

    aerometric

    9 posts

    I’m building out the blog section of a site, and I figure out why the comments form is not displaying. You can view the live page here: http://www.aerometric.com/insight/lidar-presentation/.

    - “insight” is the name of the weblog, and it is setup to allow entries.
    - Lidar Presentation is an entry
    - The “insight” weblog is setup to allow comments (in weblog administration > channel preferences)
    - I added the

    url_title="{segment_2}"

    because of a previous forum post I saw. I thought this would help, but it didn’t.
    - The comment form code IS NOT nested inside of any

    {exp:weblog:entries}
    or
    {exp:comment:entries}

    tags.

    - The documentation says the “preview” variable is required, but I don’t want to show any previews. Is there a way to not allow previewing of the comment, and to just post it when the user clicks “submit”?

    Here is the code I’m using to try & display the comments form:

    <div id="comment-form">
        {exp:comment:form weblog="insight" preview="insight/details" url_title="{segment_2}"}
        <h3>Add Your Comment</h3>
    <p>    {if logged_out}<br />
            <div class="comment_label"><br />
                    Name:<br />
                </div></p>
    
    <p>            <div class="comment_field"><br />
                    <input type="text" class="textbox" name="name" value="{name}" /><br />
                </div><br />
                <br />
                <div class="comment_label"><br />
                    Email:<br />
                </div></p>
    
    <p>            <div class="comment_field"><br />
                    <input type="text" class="textbox" name="email" value="{email}" /><br />
                </div></p>
    
    <p>            <div class="comment_label"><br />
                    URL:<br />
                </div><br />
        <br />
                <div class="comment_field"><br />
                    <input type="text" class="textbox" name="url" value="{url}" /><br />
                </div><br />
            {/if}<br />
            <br />
            <div class="comment_label"><br />
                Comments:<br />
            </div></p>
    
    <p>        <div class="comment_field"><br />
                <textarea name="comment" cols="60" rows="12">{comment}</textarea><br />
            </div></p>
    
    <p>        {if logged_out}<br />
                <div class="comment_field"><br />
                    <br />
                    <input type="checkbox" class="check" name="save_info" value="yes" {save_info} /> <br />
                    Remember me?<br />
                    <br />
                </div><br />
            {/if}</p>
    
    <p>        <div class="comment_field"><br />
                <br />
                <input type="checkbox" class="check" name="notify_me" value="yes" {notify_me} /> <br />
                Shoot me an email when someone responds?<br />
                <br />
            </div></p>
    
    <p>        {if captcha}<br />
                <div class="comment_label"><br />
                    Enter this word:<br />
                </div><br />
                <div class="comment_field"><br />
                    {captcha}<br />
                </div><br />
                <div class="comment_label"><br />
                    Here:<br />
                </div><br />
                <div class="comment_field"><br />
                    <br />
                    <input type="text" class="textbox" name="captcha" value="" <br />
                    size="20" maxlength="20" style="width:140px;" /><br />
                    <br />
                </div><br />
            {/if}</p>
    
    <p>        <div class="comment_field"><br />
                <br />
                <input type="image" class="comment_submit" <br />
                src="{site_url}images/interface/send-button.gif" name="submit" value="Submit" /><br />
                <br />
            </div></p>
    
    <p>    {/exp:comment:form}

  • #2 / Jan 10, 2011 2:51pm

    Barry Cogan

    291 posts

    Hi Aerometric,

    There are a few things we need to find out:

    1: What are the version and build numbers for your copy of ExpressionEngine?
    2: Are comments enabled for the specific entry in addition to the weblog?
    3: Do you have any templates saved anywhere called “lidar-presentation”?

    Please also go ahead and remove the url_title=”” parameter.

    Sincerely,
    Barry Cogan

  • #3 / Jan 10, 2011 2:59pm

    aerometric

    9 posts

    Barry,

    1. Version 1.6.9, Build 20100430
    2. Yes, comments are enabled for the specific entry, as well as the weblog (see attached image to confirm)
    3. There are no templates anywhere called “lidar-presentation”

    I have removed the url_title=”” parameter.

    If you think it would be helpful, I can include the entire page code for the single entry template. Would that help?

    Thanks,
    Dave

  • #4 / Jan 11, 2011 2:29am

    John Henry Donovan

    12339 posts

    aerometric,

    Typically a comment form would appear on an EE single entry page which would consist of 3 URL segments. This page is dynamic.

    http://yourdomain.com/index.php/template_group/template/url_title

    If you wish to use less segments than this then you are bypassing some of the EE URL dynamism so you need to add it back in. For example you will need to add back in the url_title= parameter

    http://www.aerometric.com/insight/lidar-presentation/.

    What is the name of the template you are using in the above URL. Is it the index template?

    Can you create one called test inside the insight template group. Then add the comment code above with the url_title parameter removed and visit this link

    http://www.aerometric.com/insight/test/lidar-presentation/.

  • #5 / Jan 11, 2011 10:48pm

    aerometric

    9 posts

    Hi John,

    I tried what you suggested, only using a template called “post” instead of “test”.

    - created a template called “post” inside the “insight” template group… and placed the above code into it, also removing the url_title= paramenter.
    - when you visit the url http://www.aerometric.com/insight/post/lidar-presentation/, I still don’t see the form showing up, and there is a weird issue with it repeating the footer (which I’ve used an {embed} tag for).

    I think one of the problems is the fact that I’m using the Structure plugin for all my URLs. See the attachments. One confirms the template group/template names… the other shows how Structure automatically creates an /insight/ path for the URL.

    Is there a way a bypass the Structure URLs for just single entries in the “insight” weblog? Or might there be a better way around this?

    Thanks,
    Dave

  • #6 / Jan 12, 2011 9:56am

    Sue Crocker

    26054 posts

    Since you’re using the Structure third party add-on, you’ll need to get back to them for support.

    You still might want to try using url_title parameter.

  • #7 / Jan 12, 2011 11:13am

    aerometric

    9 posts

    Thanks Sue. I’ve got it working now.

    I couldn’t get the url_title= parameter to work, but this thread on Structure’s support forum solved the issue.

    https://structure.tenderapp.com/discussions/problems/142-comment-entry-form-not-displaying

  • #8 / Jan 12, 2011 10:59pm

    Sue Crocker

    26054 posts

    Glad to hear you have a working solution! Don’t hesitate to post again as needed.

.(JavaScript must be enabled to view this email address)

ExpressionEngine News!

#eecms, #events, #releases