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.

Ordering channel results by number of entries in specific channel

January 18, 2011 1:42pm

Subscribe [2]
  • #1 / Jan 18, 2011 1:42pm

    kenny2

    90 posts

    So I am using a Channel to create some staff profiles. These staff also have a member_id so that they can post into a News Channel.

    I want to create a page that lists the names of these staff, ordered by either latest post or number of posts.

    This is what I have so far..

    From the Staff Channel the {title} field gives me the staff members name, and the custom field {profile_id} gives me the member_id. Using the Countee plugin from Getee I can also grab the number of entries that member has posted in the News Channel.

    {exp:channel:entries channel="staff"}
        {title} Entries:{exp:countee member_id="{profile_id}" channel="news"}
    {/exp:channel:entries}

    This returns all the info I need, but the problem is how to order it by number of posts, or most recent post within the News Channel. Any ideas, or would something like the User module be of use here.

    cheers Kenny

  • #2 / Jan 18, 2011 9:00pm

    Cheif

    626 posts

  • #3 / Jan 19, 2011 7:31am

    kenny2

    90 posts

    Hi Cheif, I don’t think that will that work.

    The profiles exist as entries in a Staff channel, however what I am trying to order this channel by is the number of entries that person has made in a different channel.

  • #4 / Jan 19, 2011 5:35pm

    Ingmar

    29245 posts

    I am afraid you’ll need a custom SQL query for that.

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

ExpressionEngine News!

#eecms, #events, #releases