Fork me on GitHub

Categories and sort value  Bottom

  • Hi all,

    i 'm testing the RC2 of 0.8 and i think it is much more mature then the the RC1.

    But i have still one problem:

    How can i use the categoriesUtil to sort my categories by its sort values.

    I looked at the function sortByLocale.

    In the categoriesUtil there are functionss to sort an cat-array by its name or desribtion.
    So i thought, i can add a compare function for the sort value

    Code

    function cmpSortValue($catA, $catB)
        {
            return $catB[sort_value] - $catA[sort_value];
        }


    But when i call

    Code

    CategoryUtil::sortByLocale($nodes,'cmpSortValue');


    it dosn't sort my array.

    ALso, when i add a die(); statement into the function, the request dowsn't die, so i suggest that this method isn't called.

    Can anyone help me with this problem?

    Thanks in advanced

  • Hey i solved my problem by using getCategoriesByParentID()

    This Function has a sort parameter, where i can pass sort_value.

    This does my job
  • 0 users

This list is based on users active over the last 60 minutes.