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.

ExpressionEngine 1.6.9: displaying message in case of no comment for the post

September 13, 2010 7:53am

Subscribe [5]
  • #1 / Sep 13, 2010 7:53am

    art.mania

    12 posts

    Hi friends,

    I’m a newbie. I use the code as below and it doesnt display the “no comment” message :/ just blank. I got the info from http://ellislab.com/expressionengine/user-guide/modules/comment/entries.html but not working :/ What am I missing?

    Appreciate helps! thanks a lot

    {exp:comment:entries sort="asc"}
                            
    {if no_results}
           There are no comments for this entry yet.
    {/if}    
                        
    <div class="comment">
             <div class="fineprint">
                       <span class="comment_author">{if url} <a href="http://{url}" title="{url}"> {/if} {name} {if url} </a> {/if} </span> said on <span class="comment_date">{comment_date format="%F %d, %Y"}</span>{url}
               </div>
                {comment}
    </div><!--/div comment-->
                            
    {/exp:comment:entries}

    Moved to EE 1.x Technical Support by Moderator

  • #2 / Sep 13, 2010 9:53am

    Sue Crocker

    26054 posts

    art.mania, are you getting to the form via a link to a single entry page?

    In other words, something like http://example.com/index.php/site/comment/name-of-entry where name-of-entry is the url title of an entry?

  • #3 / Sep 13, 2010 11:43am

    art.mania

    12 posts

    post, comments, comment form… everything is in 1 page such as http://www.example.com/blog/post/post_title_here/

  • #4 / Sep 13, 2010 5:01pm

    Ingmar

    29245 posts

    What version and build are you using? Any extensions?

  • #5 / Sep 13, 2010 5:06pm

    art.mania

    12 posts

    I use ExpressionEngine 1.6.9.

  • #6 / Sep 14, 2010 3:58am

    John Henry Donovan

    12339 posts

    art.mania,

    Can you try adding the channel and and the url_title parameter please?

    {exp:comment:entries channel="news" url_title="{segment_3}"}

    Have you got commenting enable in your Channel Preferences?
    Also have you got commenting turned on in the actual entry itself

  • #7 / Sep 14, 2010 4:58am

    art.mania

    12 posts

    Hi John, thanks for your time,

    I tried channel and url_title. it just cuts off the rest of page when I use them. It even doesn’t display comment form :/

    I enabled commenting. comments are being listed when there are some… and commenting is active for the post.

  • #8 / Sep 14, 2010 6:50pm

    Brandon Jones

    5500 posts

    art.mania, what if you try:

    {exp:comment:entries}
                       
       There are {absolute_count} comments for this entry.
                            
    {/exp:comment:entries}

    Is it outputting the correct number, including 0 when there are no comments?

    Can you also try disabling extensions so we can rule those out?

  • #9 / Sep 19, 2010 7:33am

    art.mania

    12 posts

    worked with the code below!

    {if comment_total == 0}
    There are no comments for this entry yet.
    {/if}
  • #10 / Sep 20, 2010 2:15am

    John Henry Donovan

    12339 posts

    Glad that worked for you. Feel free to start a new thread if you have any more questions.

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

ExpressionEngine News!

#eecms, #events, #releases