Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Dirk Strauss 1 post 71 karma points
    Dec 13, 2017 @ 11:32
    Dirk Strauss
    0

    Hi folks

    I'm so new to Umbraco, you can smell the newness :-) I need to do two things

    1. Display the media treeview as folders first alphabetically and then display files in any order (everything that isn't a folder type).
    2. Modify the Media ListView to also show folder items first in alphabetical order and then files in any order.

    What I have done so far is add a class that inherits from the ApplicationEventHandler and added an event to listen for when the tree nodes are being rendered.

    public class RegisterEvents : ApplicationEventHandler 
    { 
         protected override void ApplicationStarted(UmbracoApplicationBase umbracoApplication, ApplicationContext applicationContext)
         {
            TreeControllerBase.TreeNodesRendering += TreeControllerBase_TreeNodesRendering;
         }
    }
    

    Inside my TreeControllerBase_TreeNodesRendering event I do a bunch of stuff to check if I'm working with a folder etc. But it works and orders the treeview correctly as can be seen in the screenshot below.

    My problem however is to figure out a way to do this on the Media ListView. What would be the best way to accomplish this?

    screenshot of list view

    Thanks for the help.

Please Sign in or register to post replies

Write your reply to:

Draft