+1-888-365-2779
Try Now
More in this section

Forums / Bugs & Issues / Set Sort Order of Wiki Pages

Set Sort Order of Wiki Pages

3 posts, 1 answered
  1. Gary
    Gary avatar
    91 posts
    Registered:
    19 Jul 2007
    03 Dec 2009
    Link to this post
    It looks like the list of wiki pages is ordered by date modified descending. Is there a way to change to sort order to (for example) title ascending?

    Thanks,
    Gary
  2. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    25 Nov 2016
    03 Dec 2009
    Link to this post
    Hi Gary,

    You have to create a custom control as shown below and override CreataContentList method. Then you can use LINQ to sort the list.

    sample code

    public class WikiViewCustomControl : WikiView
    {
        public WikiViewCustomControl()
        {
     
        }
     
        public override string ItemListTemplatePath
        {
            get
            {
                return "~/Sitefinity/ControlTemplates/Wiki/WikiViewItemList.ascx";
            }
        }
     
        public override string SingleItemTemplatePath
        {
            get
            {
                return "~/Sitefinity/ControlTemplates/Wiki/WikiViewSingleItem.ascx";
            }
        }
     
     
        protected override void CreateContentList()
        {
            base.CreateContentList();
            IQueryable<IContent> dataSource = ((IList)ListContainer.RepeaterControl.DataSource).Cast<IContent>().AsQueryable<IContent>();
            ListContainer.RepeaterControl.DataSource = dataSource.OrderBy(c => c.DateModified);
        }
    }


    All the best,
    Ivan Dimitrov
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
    Answered
  3. Gary
    Gary avatar
    91 posts
    Registered:
    19 Jul 2007
    03 Dec 2009
    Link to this post
    Thank you, Ivan. That is perfect.
Register for webinar
3 posts, 1 answered