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.

My comment count is not showing

April 04, 2012 5:32pm

Subscribe [2]
  • #1 / Apr 04, 2012 5:32pm

    JulesWebb

    271 posts

    The comment count isn’t showing on my posts. I think I may be having the same issue as http://ellislab.com/forums/viewthread/211387/ I didn’t see any link to the bug report, is this something that has been resolved?

    I’m pasting my code below just in case you need to see it.

    EE v2.4.0 - Build: date 20120123

    Thanks!
    Jules

    <section id="comments">
    
        {exp:comment:entries channel="{my_channel}" limit="1" }
        
            <h4>Comments <span class="spch-bub-inside"><span class="point"> </span><em>{total_comments}</em></span></h4><p> <br />
        <br />
        {/exp:comment:entries}</p>
    
    <p>    <ol class="commentlist"><br />
            {exp:comment:entries channel="{my_channel}" sort="asc" limit="50" paginate="bottom"}<br />
            <br />
            {if comments}<br />
                <br />
            <li class="comment-content {switch="odd|even"}"><br />
            <br />
                <a name="comment{comment_id}"></a> <br />
            <br />
                <small class="commentmetadata">{comment_date format="%F %d, %Y @ %g:%i%a"}</small><br />
                <br />
                <cite><br />
                    <span class="g-image"> <br />
                    {if avatar}{avatar_url}<br />
                    {if:else}{site_url}images/avatars/default_set/aar_default.jpg<br />
                    {/if}                        <br />
                    </span><br />
                    {name}<br />
                </cite> <br />
                                       <br />
                <div class="comment_copy"><br />
                   {comment}<br />
                </div><br />
                <br />
            </li><!-- /comment-content --><br />
            <br />
                {paginate}<br />
                    <li class="paginate"> <br />
                    {if "{total_pages}" != 1}Page {current_page} of {total_pages} pages {pagination_links}{/if}<br />
                    </li><br />
                {/paginate}<br />
                <br />
            {/if}                            <br />
                                        <br />
            {/exp:comment:entries}<br />
        </ol><!-- /commentlist --><br />
        <br />
    </section><!-- /comments -->

  • #2 / Apr 05, 2012 1:54pm

    Dan Decker

    7338 posts

    Hi Jules,

    The User Guide isn’t entirely clear on this.

    Are you wanting the total number of comments for all entries in a channel, or just the total for a particular entry?

    Do you see any output from the {total_comments} variable at all?

    Let me know the number you after and the intent of your template and I’m sure I can get you the output you want.

    Cheers,

  • #3 / Apr 05, 2012 3:36pm

    JulesWebb

    271 posts

    Hi Dan

    I’m looking for the total number of comments for a particular entry, the current entry that the page is desplaying.

    Note: I swear this was working before. I just noticed it yesterday so I’m not sure if it was a result of the upgrade I did… ?

  • #4 / Apr 06, 2012 4:33pm

    Shane Eckert

    7174 posts

    Hey JulesWebb,

    Does {total_comments} output anything?

    Can you try this and see what it returns. Just a plain call for the total comments.

    {exp:comment:entries channel="blog"}
    {total_comments}
    {/exp:comment:entries}

    If that works add back the {my_channel} for channel and add the rest back in until you see this issue.

    Does that makes sense? I hope this helps!

    Cheers,

  • #5 / Apr 06, 2012 8:01pm

    JulesWebb

    271 posts

    Hi Shane

    RE: Does {total_comments} output anything?
    Answer: It gives me the number zero “0”


    RE: Can you try this and see what it returns. Just a plain call for the total comments.
    Answer: It returns zero twice (there are two comments) I added back in limit=“1” and I get zero once.

    Note: the two comments do show correctly.

  • #6 / Apr 06, 2012 8:45pm

    glenndavisgroup

    436 posts

    Hi Jules,

    Try using the channel entries tag instead and use {comment_total} to display the total comments for the current entry. I hope that helps.

    Mike

  • #7 / Apr 06, 2012 9:18pm

    JulesWebb

    271 posts

    Hi Mike

    Thank you very much! That worked perfectly.

    My issue has been resolved if you’d like to close the thread.

    Thanks everyone!
    Jules

  • #8 / Apr 09, 2012 4:30pm

    Dan Decker

    7338 posts

    Hi Jules,

    I’m glad we were able to team up and get you the answer you needed! Thanks Mike for the assist!

    If you have any other questions, just let us know in a new thread.

    Cheers!

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

ExpressionEngine News!

#eecms, #events, #releases