Wednesday, 8 February 2012

How to change the sort order in the editor tree

One of the questions I've been asked by a couple of clients now is whether there is a way to sort the items that appear in the editor tree.

I've recently been asked about one of the sites which is used to advertise cars. In the CMS there is a page called "a list of cars for sale" and underneath that we create "a car for sale". Rather than creating each new car at the bottom of the list, they want to be able to group the cars around registration date. The reason for this is to make it much easier to maintain. If you have 50 cars in a list, it's not easy to manage.

Forgive me that I'm not able to post the actual full code, but I'll do my best to point you in the right direction. It turns out the solution is quite simple. In the "a list of cars for sale" page, you can override the Children property like so:


        public override System.Collections.Generic.IList<ContentItem> Children
        {
            get
            {
                // for each of your children, cast it to a CarForSalePage and sort them with LINQ
                // then return the list cast back to a list of content items
            }
        }

Using this method you really have a powerful tool at your disposal for cutomising the editor. If.. (if!) I ever get time I'd like to fork the code and look at being able to customise this in the admin tool.

Hope this helps!

27 comments:

  1. lots of cool stuff, thanks for doing this blog, am looking into using n2, webforms

    ReplyDelete
  2. Cheers Jason, glad you are enjoying them!

    ReplyDelete
  3. Hi I need to add javascripts is there a way to do i am searching them

    ReplyDelete
  4. hi did you find a way to fix the issue with the visual editor and the masterpages?

    ReplyDelete
  5. Hi Anonymous and Paris, can you give some more details on what you are looking for and I will try to help!

    ReplyDelete
  6. A CMS makes it easier for people to create, edit and publish content on a website. Website publishing has required significant technical skills (HTML, programming).
    Website Design Companies | Web Design Companies Bangalore

    ReplyDelete
  7. I thing this is the programming information of website and application developers to change the sort order in the editor tree.
    Web Design Company India | Web Designing Company India

    ReplyDelete
  8. Thanks so much for this helpful tips come returning for additional interesting information…Keep it up
    website design company bangalore | web designing companies bangalore

    ReplyDelete
  9. Excellent Information..It is easier for people to create, edit and publish content on a website.
    Hire Website design Company

    ReplyDelete
  10. This comment has been removed by the author.

    ReplyDelete
  11. Web development is the great concept which is explained only by experts only..You have done a great work by posting this..We hope you will keep posting web development concepts..Thank you for this post..
    Engineering Colleges In Chennai , Nautical Science Colleges In Chennai

    ReplyDelete
  12. Very useful article about seo concepts..It is very easy to understand about seo for beginerrs and learners..kepp posting useful posts like this..Old Age Home in Coimbatore, Charitable Trust in Coimbatore

    ReplyDelete
  13. The blog is absolutely truly incredible. Lots of large information and inspiration, both of which we all need.
    Bangalore Web Designing Company, Web Development Company Bangalore

    ReplyDelete
  14. I have also bookmarked you for ascertaining out new posts. thanks for displaying my commentaryary in your site.Hotels in Kumbakonam,Budget Hotels in Kumbakonam

    ReplyDelete
  15. I really loved reading your blog. It was very well authored and easy to understand.Hotels in Kumbakonam,Kumbakonam Hotels

    ReplyDelete
  16. A very well-written post. I read and liked the post and have also bookmarked you. All the best for future endeavors. Getting some solution regarding.
    UI Designing Companies, Web Application Development in Bangalore

    ReplyDelete
  17. Wow extraordinary and wonderful post....this post is very impressive..keep posting like this in our blog..thank you for this post and keep it up...SPA IN KUMBAKONAM, SPA IN TRICHY, SPA IN THANJAVUR

    ReplyDelete
  18. I am glad to read this post, its an interesting one. I am always searching for quality posts and articles and this is what I found here,I hope you will be adding more in future. Thanks.ITFOFINDIA,ITF OF INDIA

    ReplyDelete
  19. Thanks for the very informative blog, extremely grateful that you perform this piece of writing very simply, I mean to say that it's quite simple to read and understand. You can also share these type of content on sites like Free Samples 411

    ReplyDelete
  20. The post is very informative. It is a pleasure reading it. I have also bookmarked you for checking out new posts. You can also share this valuable content on other platforms such as Blogspot, the famous Wordpress site, the innovative Tumblr site and also the sites like Medium and the famous Live Journal site.

    ReplyDelete
  21. Thank you for sharing this information. Come back again for more interesting stuff like this post. You can share this informative post in Social Media sites like the worldwide famous Facebook, the all-time favorite Twitter and the most interesting Google Plus site, business site LinkedIn and also to the Infographic site Pinterest to generate more traffic to your blog post.

    ReplyDelete
  22. I have analyzed your post. Excellent details you did here. I enjoyed reading your blog, and it is both instructional and enjoyable. Share this most interesting post in other sites like OS Business Opportunities, the innovative Asaim Japan site and also to the Jfissures site followed by Automation Associaltes LLC and lastly to the sites like Johny Adams sites.

    ReplyDelete
  23. Pretty good post. I just stumbled upon your blog and wanted to say that I have really enjoyed reading your blog
    Yasir Jamal

    ReplyDelete
  24. This comment has been removed by the author.

    ReplyDelete
  25. Thank u for your information and get more new update your page For More Details:Find Girls, Search Bride,Check Your Life Partner,SecondMarriageMatrimony.

    ReplyDelete