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.

no_result for comments not displaying anything.

January 23, 2011 12:44pm

Subscribe [3]
  • #1 / Jan 23, 2011 12:44pm

    Citylogic

    26 posts

    Comments show like they are supposed to but when there are no_results, nothing shows up. I just get a blank.
    Using 2.1.3 Build 20101220

    Here is my code:

    Article Comments

    {exp:comment:entries channel="articles"}

    {if no_results}
      <div class=“comment-content”>
          There are currently no comments.
      </div>
    {/if}
     
    <div class=“comment-content”>
          {comment}
    </div>

    {/exp:comment:entries}

  • #2 / Jan 24, 2011 3:57am

    John Henry Donovan

    12339 posts

    Citylogic,

    Can you try explicitly adding the entry_id to the tag and see if it returns your no_results contents?

    {exp:comment:entries channel="articles" entry_id="12"}
    {if no_results}
      <div class="comment-content">
          There are currently no comments.
      </div>
    {/if}
     
    <div class="comment-content">
          {comment}
    </div>
    
    {/exp:comment:entries}

    What does the URL look like to your comment page?

  • #3 / Jan 24, 2011 4:20am

    Citylogic

    26 posts

    Hi John,

    Still no luck with the entry id included.

    The URL looks like this:
    http://ttm.citylogic.co.za/football/news/orlando_pirates_stage_an_incredible_second_half_comeback/11-01-24

    I am putting comments under the article body within the {exp:channel:entries} tag.

  • #4 / Jan 24, 2011 4:27am

    John Henry Donovan

    12339 posts

    Citylogic,

    Do not nest your comments tags within your channel:entries tag. Put them outside

  • #5 / Jan 24, 2011 4:44am

    Citylogic

    26 posts

    Fixed it. Thanks. I’m learning 😊

  • #6 / Jan 24, 2011 10:10am

    Sue Crocker

    26054 posts

    Glad John was able to help. Don’t hesitate to post again as needed.

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

ExpressionEngine News!

#eecms, #events, #releases