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 And Comment Form Not Displaying

January 10, 2012 1:00pm

Subscribe [3]
  • #1 / Jan 10, 2012 1:00pm

    Jeremy Bise

    77 posts

    I’m on EE 2.3.1.

    Comments module is enabled.

    Allow comments is checked in both the channel’s preferences as well as on individual entries.

    We only have two entries in the channel right now (it’s a blog.)  Comments and comment form shows up properly on the first entry.  The second entry is not showing the form or the comments (actually, there are no comments, but it’s supposed to be showing a {if no_results} blurb).

    Any thoughts on what I’ve missed?

    Comments List:

    {exp:comment:entries sort="asc" limit="20"}
       <div class="comment">
          <div class="comment_info">
           
           <strong>{url_as_author}</strong>
          
          </div>
        <div class="comment_body">
           {comment}
          </div>
          
          <span class="comment_date">{comment_date format="{global:date_short}"}</span>
        
        </div>
        
        {if no_results}
         
          There are no comments on this article yet. Why not be the first?
        
       {/if}
      {/exp:comment:entries}

    Comment Form:

    {exp:comment:form channel="blog" form_class="nice"}
      
      {if logged_out}
       
         <label for="name">Name:</label> <input type="text" name="name" id="name" value="{name}" class="input-text" />
        
        
         <label for="email">Email:</label> <input type="text" name="email" id="email" value="{email}" class="input-text" />
        
        
         <label for="url">URL:</label> <input type="text" name="url" value="{url}" id="url" class="input-text" />
       
      {/if}
      
      
       <label for="comment">Comment:</label>
       <textarea name="comment" id="comment">{comment}</textarea>
      
      
      
       <label><input type="checkbox" name="save_info" value="yes" {save_info} /> Remember my personal information</label>
      
      
      
       <label><input type="checkbox" name="notify_me" value="yes" {notify_me} /> Notify me of follow-up comments?</label>
      
      
      {if captcha}
       
         <label for="captcha">Please enter the word you see in the image below:</label>
         {captcha}
    
         <input type="text" name="captcha" value="{captcha_word}" maxlength="20" class="input-text" />
       
      {/if}
      
      
       <input type="submit" name="submit" value="Submit" />
      
      
      {/exp:comment:form}
  • #2 / Jan 11, 2012 3:29pm

    Jeremy Bise

    77 posts

    Sorry to bump this, but does anybody have any thoughts or suggestions I could try?

    Thanks,
    Jeremy

  • #3 / Jan 11, 2012 4:14pm

    Dan Decker

    7338 posts

    Hi Jeremy,

    No worries on the bump, I understand you frustration in waiting for a reply. It seems you are saying that both entries are being displayed in the same template? That one entry displays fine, while the other shows nothing? Can you show us the overall context of the template here?

    Since we have one entry that is working and one that is not, let’s try to find the differences between the two. Do they have the same status and author? Anything that is dissimilar between the two entries Does the entry content show other than the comment form?

  • #4 / Jan 11, 2012 5:18pm

    Jeremy Bise

    77 posts

    Hi Dan,

    These templates are creating your standard blog.  We have an index of all articles and then a template for individual articles.  The template we’re having trouble with is on the main articles.  For both entries I’m describing, our custom fields show up fine.  On the first entry, the comments and comments form are showing up fine.  But on the second entry, neither the comments nor the comment form is showing up.  I’ve coded plenty of comment forms, but this hasn’t happened before.  Allow comments is enabled on the channel as well as on the individual entries.  We have the same author, same status (Open), and same everything else as far as I can tell.  The only differences are the entry dates (both in the past) as well as the title, url_title, and body fields.  All else is the same.

    Again, I’ve never ever had this happen before—it’s sort of throwing me for a loop.  I even tested a third entry and the comments stuff shows up fine on a third entry—just not this particular one.

    Any ideas?

    Thanks,
    Jeremy

  • #5 / Jan 16, 2012 8:54pm

    Sean C. Smith

    3818 posts

    Hi Jeremy,

    That is really odd. I know you have posted the comments list and comment entry code above but what i’d really like to see is the complete template code to better trouble shoot. could you paste that here. If the template is too big to post here feel free to use a pastie.

    Sean

  • #6 / Jan 17, 2012 8:47am

    Jeremy Bise

    77 posts

    Sean, here is the entire template:

    {embed="inc/header"}
    
    {exp:channel:entries channel="blog" disable="trackbacks|member_data" limit="1"}
    <div id="content" class="container">
     <div class="row">
      <div class="twelve columns">
       <div class="page-heading">
        <h1>{title}</h1>
        
         {entry_date format="{global:date_short}"} / <a href="#comments">{comment_total} comments</a> / <a href="http://{page_url}">Permalink</a>
        
       </div> <!-- end .page-heading -->
      </div> <!-- end .twelve .columns -->
     </div> <!-- end .row -->
     
     <div class="row">
      <div class="nine columns">
       <div class="row">
        <div class="three columns show-on-desktops">
         {related_entries id="blog-author"}
          <div class="post-author">
           
            {exp:imgsizer:size src="{team-photo}" width="120" height="120"}
             {sized}
            {/exp:imgsizer:size}
           
           
            <span class="author-name">{title}</span>
    
            <span class="team-title">{team-title}</span>
           
          </div>
         {/related_entries}
        </div>
        <div class="eight columns">
         <div class="blog-body-excerpt">{blog-body:excerpt}</div>
         {blog-body:extended}
      {/exp:channel:entries}
      
      <h3 id="comments">Comments</h3>
      {exp:comment:entries sort="asc" limit="20"}
       <div class="comment">
          <div class="comment_info">
           
           <strong>{url_as_author}</strong>
          
          </div>
        <div class="comment_body">
           {comment}
          </div>
          
          <span class="comment_date">{comment_date format="{global:date_short}"}</span>
        
        </div>
        
        {if no_results}
         
          There are no comments on this article yet. Why not be the first?
        
       {/if}
      {/exp:comment:entries}
      
      <h3 id="post-comment">Post Your Thoughts:</h3>
      {exp:comment:form channel="blog" form_class="nice"}
      
      {if logged_out}
       
         <label for="name">Name:</label> <input type="text" name="name" id="name" value="{name}" class="input-text" />
        
        
         <label for="email">Email:</label> <input type="text" name="email" id="email" value="{email}" class="input-text" />
        
        
         <label for="url">URL:</label> <input type="text" name="url" value="{url}" id="url" class="input-text" />
       
      {/if}
      
      
       <label for="comment">Comment:</label>
       <textarea name="comment" id="comment">{comment}</textarea>
      
      
      
       <label><input type="checkbox" name="save_info" value="yes" {save_info} /> Remember my personal information</label>
      
      
      
       <label><input type="checkbox" name="notify_me" value="yes" {notify_me} /> Notify me of follow-up comments?</label>
      
      
      {if captcha}
       
         <label for="captcha">Please enter the word you see in the image below:</label>
         {captcha}
    
         <input type="text" name="captcha" value="{captcha_word}" maxlength="20" class="input-text" />
       
      {/if}
      
      
       <input type="submit" name="submit" value="Submit" />
      
      
      {/exp:comment:form}
    
    
      </div> <!-- end .eight columns -->
      </div> <!-- end .nine columns -->
      </div> <!-- end .row -->
      
      <div class="three columns">
       {embed="blog/_share" share_url="{structure:page:url}"}
           
       {exp:channel:entries channel="blog" disable="trackbacks|member_data" limit="1"}
        <h4>Related Topics</h4>
    <p>    <ul id="blog-topics"><br />
         {categories}<br />
              <li><a href="http://{path=blog/index}"><span>{category_name}</span></a></li><br />
         {/categories}<br />
        </ul><br />
       {/exp:channel:entries}<br />
       <br />
      </p><h4>Related Articles</h4>
    <p>   <ul id="related-articles"><br />
        {exp:channel:entries related_categories_mode="yes" disable="trackbacks|comments|member_data" limit="3"}<br />
         <li><a href="http://{page_url}">{title}</a></li><br />
        {/exp:channel:entries}<br />
       </ul><br />
      </div><br />
     </div><br />
    </div> <!-- end #content --></p>
    
    <p>{embed="inc/footer"}

  • #7 / Jan 17, 2012 11:32pm

    bcrabtree

    60 posts

    Hi all,

    Just wanted to chime in because I am having the exact same problem.

    In my {exp:comment:entries} loop the content inside my {if no_results} conditional is not showing up when there are no comments.

    If there are comments they show up just fine.

    Could this be a bug in the latest release?

    I’m running v2.3.1 - build: 20111017

    Here’s my code:

    {exp:comment:entries channel="{my_channel}" orderby="date" sort="desc"}
     {if no_results}
      There are no comments for this entry yet.
     {/if}
     <div id="comment">
      {if avatar} 
       {avatar_url}
      {if:else} 
       {exp:gravatar email=
      {/if}
      {comment}
      Posted by <strong>{url_as_author}</strong> | {comment_date format='%F %j%S, %Y'} | {comment_date format='%g:%i %A'}
     </div>
    {/exp:comment:entries}

    Cheers.

  • #8 / Jan 17, 2012 11:34pm

    Jeremy Bise

    77 posts

    Bryan,

    Is your comment form showing up for that entry?  Just curious because that’s how mine is acting—no comments, no no_results, and no comment form.  I haven’t tried manually creating a comment to see if something shows up then.

  • #9 / Jan 18, 2012 1:29am

    bcrabtree

    60 posts

    Hey Jeremy,

    Yes, everything is showing up except what I put inside the no_results conditional.

    My comments are set to show up on my single entry page and my {exp} loops are stacked like so:

    {exp:channel:entries channel="{my_channel}" url_title="{segment_2}" disable="member_data|trackbacks"}
        <!-- Entry Code -->
    {/exp:channel:entries}
    
    {exp:comment:entries channel="{my_channel}" orderby="date" sort="desc"}
        <!-- Comment Code -->
    {/exp:comment:entries}
    
    {exp:comment:form channel="{my_channel}" form_id="commentForm"}
        <!-- Comment Form Code -->
    {/exp:comment:form}

     

  • #10 / Jan 18, 2012 2:03am

    bcrabtree

    60 posts

    Nevermind,

    I broke my code down piece by piece to bare essentials for testing and discovered it was actually a parse=“inward” issue with the third-party switchee plugin I’m using.

    My bad.


    Jeremy,

    Are you checking this on a single entry page? ie: the entry {url_title} or {entry_id} is actually in the address bar. (http://www.mywebsite.com/blog/url_title)

    I ask because I noticed that you are using limit=“1” in your {exp:channel:entries} tag and I know that non-single entry pages automatically hide comments and the comment form.

    Cheers,
    Bryan

  • #11 / Jan 18, 2012 8:37am

    Jeremy Bise

    77 posts

    Your mention of the url_title got me to remembering that I changed the URL title on the entry.  Since I’m using Structure, there’s also a Structure Listing URL on the Structure tab which I did not change, so it did not match the new url_title.  I went and made those two match and, behold, the comments section and form both showed up. I don’t really know how all the parsing stuff works, but apparently those two matching matters! Problem solved.

  • #12 / Jan 23, 2012 7:22pm

    Sean C. Smith

    3818 posts

    Jeremy,

    Glad to see you got this resolved. I’m going to close out this thread, but feel free to post again when you have more questions.

    Sean

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

ExpressionEngine News!

#eecms, #events, #releases