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.

Multiple "orderby" behavior?

October 25, 2010 11:25am

Subscribe [2]
  • #1 / Oct 25, 2010 11:25am

    ira42

    167 posts

    Hey there,

    Was wondering if this is a bug,  or expected behavior…  I have a weblog:entries tag,  which is set roughly as follows:

    {exp:weblog:entries weblog="weblog_name" status="not Closed" orderby="title|date" sort="asc|desc"}

    I was expecting this to order alphabetically by title,  then within this,  order by date.  It seems to be ignoring the date order/sort.  My entries are as follows:

    Entry info:
    
    - Product One v.1.0 (entry date:  Jan 2010)
    - Product One v.2.0 (entry date:  June 2010)
    - Product One v.3.0 (entry date:  July 2010)
    - Product Two v.1.0 (entry date:  Jan 2010)

    So I would expect it to list by Alpha, then Date Desc within each Alpha:

    What I would expect:
    
    - Product One v.3.0 (July)
    - Product One v.2.0 (June)
    - Product One v.1.0 (Jan)
    - Product Two v.1.0
    What I am actually getting:
    
    - Product One v.1.0 (Jan)
    - Product One v.2.0 (June)
    - Product One v.3.0 (July)
    - Product Two v.1.0

    I am on version EE 1.6.9.

    Tx!

  • #2 / Oct 26, 2010 9:23am

    Sue Crocker

    26054 posts

    You have date sorting by desc, which means newest first. So it looks like that sorted correctly in that case.

  • #3 / Oct 26, 2010 9:28am

    ira42

    167 posts

    Hi Sue,

    Updated my post for clarity.  Yes,  I would expect to get the Date sorted Desc as specified in the weblog tag,  but the results are ignoring the date sort altogether.

    Ira

  • #4 / Oct 26, 2010 9:50am

    ira42

    167 posts

    Hmmmm… Wonder if it’s that the “v.X.X” in the titles are being used to satisfy the “sort by titlte, ASC”?  In which case,  I guess it’s working,  but never gets to the date sort,  because it will always order v.1, v.2, v.3 alphabetically first…

    I think if I had two entries called
    “Product One v.1.0” with different dates,  it would sort those entries by date, desc.

    If that’s the case,  please go ahead and close this post,  tx!

    Ira

  • #5 / Oct 26, 2010 4:14pm

    Sue Crocker

    26054 posts

    Sounds good to me. Don’t hesitate to post again as needed.

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

ExpressionEngine News!

#eecms, #events, #releases