Forum Discussion

justageek's avatar
justageek
Helper
11 years ago

Get all community categories with sort order

Is it possible to include some sorting or weight value in the category data when retrieving the categories for a community via the API?

 

Our primary API account retrieves the categories and they are orded the way an admin user sees them when the login.  We need to know the order for a category as seen by a normal community user account.  There doesn't appear to be a weight value returned with the category data.  Is this stored in some other fashion?

3 Replies

  • PaoloT's avatar
    PaoloT
    Lithium Alumni (Retired)
    11 years ago

    Hi justageek 

     

    I believe the REST API will return the categories in the order they are set up in the Admin's "Community Structure". As far as I am aware, this will apply to every user. There isn't any ordering information associated with the API response, it just reflects how the structure is ordered in Admin.

     

    This is based on my experience, you may want to ask to support to confirm this with our Product management team.

     

    Thanks,

     

     

  • justageek's avatar
    justageek
    Helper
    11 years ago

    Thanks for the reply.  We have one API user account that has elevated priveleges.  When I login via the browser with this account, I see the categories ordered in the same way as if I click through to the Community Structure admin UI.  When I login as a "standard" user, they are ordered the same except that some categories are just not displayed, so I supposed this is based on permissions or something like that.  I cannot see a way to assign permissions based on categories, so I will look for that information.

  • nathan's avatar
    nathan
    Executive
    11 years ago

    Lithium generally hides things if the user doesn't have permissions to access. (It also tends to hide things if they are empty).

     

    AFAIK, the order is always as it appears in the community structure, just with categories/boards hidden as appropriate. If this causes confusion, you might want to consider putting all the limited-access categories at the bottom.