More in this section

Forum sorting

9 posts, 0 answered
  1. Adam Ruth
    Adam Ruth avatar
    4 posts
    Registered:
    27 Oct 2006
    17 Sep 2008
    Link to this post
    How can I get the forums and forum categories to sort alphabetically? Right now they appear to be sorted randomly. For example, I have forums in the following order:

    Active Directory
    WMI
    Free Utilities

    Thanks

    Adam
  2. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    12 Sep 2017
    17 Sep 2008
    Link to this post
    Hi Adam Ruth,

    Thank you for using our services.

    The possible solution is to create a new provider that inherits Telerik.Forums.Data.DefaultProvider. After that, you need to override the GetCategories() method and call GetCategories(String). Thus, you will get all the categories sorted by a specified sorting expression.

    For more information, please take a look at our DeveloperManual - GetCategories Method  and Customize the forum providers

    Hope this helps.

    Sincerely yours,
    Ivan Dimitrov
    the Telerik team

    Check out Telerik Trainer, the state of the art learning tool for Telerik products.
  3. CSoft
    CSoft avatar
    8 posts
    Registered:
    29 Aug 2005
    16 Mar 2009
    Link to this post
    Guys,

    Is there a better way to sort both Forum Categories and Forums?
  4. Dido
    Dido avatar
    149 posts
    Registered:
    24 Sep 2012
    19 Mar 2009
    Link to this post
    Hi Harvey,

    Ivan has suggested the solution to your problem. Here is an example of how to use GetCategories(string sortExpr), the various GetPost and GetForum overrides. The latter does not perform sort, but if you override the default provider and get base.GetForum(...), you could sort it with linq, or any other way you prefer (probably Array.Sort()).

    Generally, what you need to to do is inherit a class, override two methods and change the provider name for your control through the Sitefinity GUI. 

    Greetings,
    Dido
    the Telerik team


    Instantly find answers to your questions on the new Telerik Support Portal.
    Check out the tips for optimizing your support resource searches.
  5. UI Crew
    UI Crew avatar
    99 posts
    Registered:
    24 Sep 2012
    14 May 2009
    Link to this post
    Hi Harvey and Adam,

    Were any of you guys able to do this - eg. Sort the Forum categories alphabetically?

    Thanks

    Seth
  6. CSoft
    CSoft avatar
    8 posts
    Registered:
    29 Aug 2005
    14 May 2009
    Link to this post
    Never tried to get this to work.

    Had to ditch the Sitefinity Forums module in the end -- too many issues.
  7. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    12 Sep 2017
    14 May 2009
    Link to this post
    Hello Harvey,

    You can directly  use Manager.GetCategories(string SortExp) method to get the categories sorted by name alphabetically.

    Telerik.Forums.ForumManager forumManager = new Telerik.Forums.ForumManager(); 
    // get all categories sorted by an expression 
    IList listOfAllCategories = forumManager.GetCategories("Name ASC");  

    If your approach is different let us know.

    Sincerely yours,
    Ivan Dimitrov
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Check out the tips for optimizing your support resource searches.
  8. UI Crew
    UI Crew avatar
    99 posts
    Registered:
    24 Sep 2012
    16 May 2009
    Link to this post
    Hi Ivan,

    I was actually wanting to sort the categories in the forums list page not just the categories by themselves.

    The just seem to come out in any strange order they wish. 

    I would have thought this would have been a pretty standard requirement of a Forums module with forum categories.

    Would the team be able to provide sample code with a KB article or something to overcome this shortfall?

    Cheers,

    Seth
  9. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    12 Sep 2017
    16 May 2009
    Link to this post
    Hi Seth Cleaver,

    Thank you for using our services.

    The current API does not support your requirement. We will consider this as implementation for 4.0 when Forums module will be completely rewritten.

    Sincerely yours,
    Ivan Dimitrov
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Check out the tips for optimizing your support resource searches.
Register for webinar
9 posts, 0 answered