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.

Sort order issue

July 09, 2012 6:24am

Subscribe [1]
  • #1 / Jul 09, 2012 6:24am

    mattbee

    2 posts

    Hi everyone,

    I have a problem with ordering channel entry results, when listing a category, with numerous other category dependencies I base queries on.

    I have the following query:

    {exp:channel:entries channel="products" status="published|open|not draft|not closed" category="{category_id}&16;" orderby="custom_order" sort="ASC" dynamic="no"}

    within a loop for exp:channel:category_heading to get the category_id variable.

    The query appears correct and 2 products are listed - each has a custom_order text field, of which one value is 10 and one is 20

    What I can’t understand is why the value 20 is being displayed first, and changing orderby and sort change nothing.

    Edit: In addition, changing the sort parameter value to sort=“DESC” makes zero difference to the result order.

    Anyone any ideas?

    Matt

  • #2 / Jul 10, 2012 4:58pm

    Kevin Smith

    4784 posts

    Hi Matt,

    What kind of field is “custom_order”? Is it a text input field with the “Field Content” option set to number? If you try that, does the sorting work as expected?

  • #3 / Jul 17, 2012 9:06am

    mattbee

    2 posts

    Thanks Kevin,

    Worked a treat, also changed the order=“asc” to lower case (was ASC) but I don’t know if it is case sensitve or not - but one of the 2 changes did it!

    Matt

  • #4 / Jul 17, 2012 5:32pm

    Kevin Smith

    4784 posts

    Awesome! Glad to see that took care of everything. Let us know if we can help again in the future!

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

ExpressionEngine News!

#eecms, #events, #releases