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.

Display the 20 most recent comments by date, descending

January 26, 2010 6:27am

Subscribe [2]
  • #1 / Jan 26, 2010 6:27am

    arilyn

    8 posts

    I’m looking for a way to display the 20 most recent comments on an entry from least recent to most recent. Is this possible with just EE? I’m building a chat-like interface for a page on my site.

    This is what I’m looking for:

    <!--6 more comments-->
    01/25 12:22:46 PM [Kerune]: {comment}
    01/25 12:28:24 PM [Zeitgeist]: {comment}
    01/25 12:57:56 PM [Atraiyu]: {comment}
    01/25 12:59:42 PM [Atraiyu]: {comment}
    01/25 01:29:35 PM [Atraiyu]: {comment}
    01/25 02:07:18 PM [Faires]: {comment}
    01/25 02:24:47 PM [Clyche]: {comment}
    01/25 02:25:08 PM [Clyche]: {comment}
    01/25 05:42:50 PM [Arilyn]: {comment}
    01/25 05:43:25 PM [Arilyn]: {comment}
    01/25 06:11:16 PM [Clyche]: {comment}
    01/25 06:24:17 PM [Tsiksun]: {comment}
    01/25 06:44:42 PM [Cprawr]: {comment}
    01/26 01:57:28 AM [Zeitgeist]: {comment}

    This code gets the sort order correct, but it only shows the 20 first comments on the entry. I need the 20 most recent:

    {exp:comment:entries entry_id="13" limit="20" orderby="date" sort="asc"}

    This code shows the 20 latest comments, but it’s sorted from newest to oldest. I need it from oldest to newest:

    {exp:comment:entries entry_id="13" limit="20" orderby="date" sort="desc"}
  • #2 / Mar 09, 2010 5:47pm

    lebisol

    2234 posts

    You can try using a jquery or using a query module to pull the comments.

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

ExpressionEngine News!

#eecms, #events, #releases