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.

Comments Not Quite Working?

September 01, 2008 3:54pm

Subscribe [5]
  • #1 / Sep 01, 2008 3:54pm

    drawbackwards

    12 posts

    Hey there!

    I’ve been working on getting the blog set up on a site. And I can’t seem to get the comments form to work correctly.

    http://childmark.com/blog/5_ways_to_stimulate_your_babys_eyesight/

    It appears on the single entry page, but when you enter your comment, it doesn’t post to the entry.

    Comments are allowed within this weblog, so I’m a little confused as to what might be the problem.

    Thanks for all your help ahead of time!

    Mod Edit: Moved to the Technical Support forum.
    Mod Edit: Moved to the Howto forum as per request.

  • #2 / Sep 01, 2008 7:11pm

    Jack McDade

    425 posts

    Can we see the code you’re using? There are two separate sets of tags you’ll need to use, one for posting and one for viewing.

    For posting the comments:

    {exp:comment:form}
    <!--Your parameters here, such as {name}, {email} etc… -->
    {/exp:comment:form}

    and then the comments entries:

    {exp:comment:entries sort="asc" limit="20"}
    {comment} 
    by {name} on {comment_date format="%Y %m %d"} <!-- or whatever you want to show… -->
    {/exp:comment:entries}

    How you lookin? Take a look here if you need to: Entries or Posting

  • #3 / Sep 01, 2008 7:36pm

    Sue Crocker

    26054 posts

    drawbackwards, did the information from Jack help?

    Thanks for the assist, Jack. 😊

  • #4 / Sep 01, 2008 8:52pm

    drawbackwards

    12 posts

    This is the code blocks I’m using. These are located outside of the entries tag.

    {exp:comment:entries sort="asc" weblog="blog"}
    
    {comment}
    
    By {name}      {relative_date} ago
    
    {/exp:comment:entries}
    {exp:comment:form weblog="blog"}
    
    {if logged_out}
    
    Name: <input type="text" name="name" value="{name}" size="50" /></p>
    
    Email: <input type="text" name="email" value="{email}" size="50" /></p>
    
    Location: <input type="text" name="location" value="{location}" size="50" /></p>
    
    URL: <input type="text" name="url" value="{url}" size="50" /></p>
    
    {/if}
    Enter Your Comment:
    <textarea name="comment" cols="79" rows="8">{comment}</textarea></p>
    
    <input type="checkbox" name="save_info" value="yes" {save_info} /> Remember my personal information
    
    <input type="checkbox" name="notify_me" value="yes" {notify_me} /> Notify me of follow-up comments?
    
    <input type="submit" name="submit" value="Submit" />
    
    {/exp:comment:form}
  • #5 / Sep 01, 2008 9:08pm

    Jack McDade

    425 posts

    try removing the weblog=“blog” line from {exp:comment:entries sort="asc" weblog="blog"}. Comments are meant to be dynamic/relative to your URL in some cases. That might do it for ya.

  • #6 / Sep 01, 2008 9:12pm

    drawbackwards

    12 posts

    Removed the weblog mention out of both calls and still no go.

    Perhaps I need something in the url to tell it it’s a single post?? I figured if it was showing up it would work as well?

  • #7 / Sep 01, 2008 9:39pm

    Sue Crocker

    26054 posts

    Perhaps I need something in the url to tell it it’s a single post?? I figured if it was showing up it would work as well?

    Yes, you do need something in the url.

    SheBlogs.com - Click on one of the comments link, and you’ll be taken to the comment page for that entry. You’ll notice the third segment has the URL title in it.

    I’m pretty much using the standard comments code that came with the stock templates.

    <a href="http://www.sheblogs.com/index.php/site/comments/no-reverse/">http://www.sheblogs.com/index.php/site/comments/no-reverse/</a>
  • #8 / Sep 01, 2008 9:52pm

    drawbackwards

    12 posts

    Ok so I can’t just have the comments listed at the bottom of a single post? That’s kinda lame…

    Are you sure that’s the only way it can be done? I thought I’d seen it done in a more “wordpress” style with the comments right under the post on a single post item… I’ll have to keep looking.

  • #9 / Sep 01, 2008 10:18pm

    Sue Crocker

    26054 posts

    You could use an embed and pass the {url_title} to that embed. That would get around the issue.

    I don’t have an example in my sites, but I could move this to the HowTo forum to some community involvement.

  • #10 / Sep 02, 2008 1:18am

    drawbackwards

    12 posts

    Sue,

    If you could move this tread back over to How To so that we might get an example of how to do this that would be very helpful.

    Thanks!

  • #11 / Sep 02, 2008 5:21am

    Ingmar

    29245 posts

    There we go.

  • #12 / Sep 02, 2008 7:12am

    cherrypj

    158 posts

    Here’s what I did for one of my sites—greatly simplified, of course. This is for a page where the url_title appears in the URL.

    The entry shows here:

    {exp:weblog:entries weblog="stories" limit="1" disable="trackbacks"}
      <h1>{title}</h1>
      <div class="byline">
        <h2><span class="date">{entry_date format="%F %j, %Y"}</span> | by <a href="/user/{username}/">{author}</a></h2>
    <p>  </div><br />
      <div class="story-body"><br />
        {stories_body}<br />
      </div><br />
    {/exp:weblog:entries}

    Below this, I have my comments, both the existing comments and the comments form. Since I only allow members to post a comment, I didn’t need to add the fields for name and email address.

    {!-- COMMENTS LIST --}
    <h3 id="comment">Comments</h3>
    <ol>
      {exp:comment:entries weblog="stories" url_title="{segment_3}"}
        <li id="{comment_id}">
          {comment}
        </li>
      {/exp:comment:entries}
    </ol>
    
    {!-- COMMENT FORM --}
    {exp:comment:form}
      <h3 id="post-comment">Post a Comment</h3>
      <fieldset>
        <label for="post-comment-text">Your Comment</label>
        <textarea id="post-comment-text" name="comment" cols="20" rows="5">{comment}</textarea>
    
        <input type="checkbox" id="notify-comment" name="notify_me" value="yes" {notify_me} />
        <label class="check" for="notify-comment">Notify me of follow-up comments?</label>
    
        <input type="image" name="submit" src="/css/i/btn-postcomment.gif" alt="Post Comment" />
      </fieldset>
    {/exp:comment:form}

    Hope this helps!

  • #13 / Sep 02, 2008 12:44pm

    drawbackwards

    12 posts

    Thank you but I think my issue is that the form doesn’t post the comment to the database? Any ideas why that could be happening?

  • #14 / Sep 02, 2008 12:47pm

    Jack McDade

    425 posts

    Are you sure? Can you check the exp_comments table to confirm that? If so, might be a read/write issue or a permissions problem.

  • #15 / Sep 02, 2008 1:03pm

    drawbackwards

    12 posts

    Yep, no entries in the database within the comments table.

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

ExpressionEngine News!

#eecms, #events, #releases