Copied to clipboard

Flag this post as spam?

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


  • Simon Yohannes 58 posts 188 karma points
    Oct 19, 2010 @ 18:27
    Simon Yohannes
    0

    best way to customize javascript content tree?

    right now i'm using date folders to organize articles (year/month/day) and the layout looks like this:

    news

    -2010

    --10

    ---19

    ----news article

     

    i'd like to customize the javascript tree so that when i expand the news folder, i get top x latest news articles with a button to stream in more when clicked and another button to revert to usual view (archive view, above), sorta like this:

    news

    -latest article

    -next article

    -next article etc

    +more

    +archive view

    is there any documentation to assist in messing with the umbraco UI in this way? at the moment, my clients are describing it as clunky ;/

     

    thanks

    Simon

  • Rich Green 2246 posts 4008 karma points
    Oct 19, 2010 @ 18:51
    Rich Green
    0

    Which version of Umbraco are you using?

    Not exactly an answer to yor question, but you could  look at adding a dashboard in the content area which allows instant access to the Latest news articles etc. your clients could then click any of these to get directly to the tree.

    Rich

  • Tom Fulton 2030 posts 4998 karma points c-trib
    Oct 19, 2010 @ 18:58
    Tom Fulton
    1

    Not sure about modifying the tree, but thought I'd throw this out there as a suggestion:  F.A.L.M. Tabular Folder Browser.  I haven't used it yet but have been meaning to try it.  I think you could use it as sort of a "Dashboard" on the root "News" node, and your editors could use it to easily browse/find the News articles beneath it, without having to use the tree.

    One thing you could also do for the "Latest/next/next/archive" stuff is to use event handlers or scheduled tasks to move the articles around.  For example, I have an Events node that lists current events underneath.  A scheduled task checks once a day for any events that are passed, and moves them into the Events -> Archived folder.  You could do this in an event - ie when a new article is added to News, find the oldest one and move it into "More" or "Archived" etc...

    Just my basic thoughts..

  • Jeff Grine 149 posts 189 karma points
    Oct 19, 2010 @ 20:19
    Jeff Grine
    0

    Can't find any documentation right now, but if you're using 4.5.2, there are events for the tree loading that you can tap into. I'm using it to sort the tree without hitting the database, but you might find it useful.

    loadContent.AfterTreeRender += new EventHandler<TreeEventArgs>(loadContent_AfterTreeRender);
    
    void loadContent_AfterTreeRender(object sender, TreeEventArgs e)
            {
                var docs = sender as Document[];
                if (docs != null && docs[0].ContentType.Alias == "Article")
                { e.Tree.treeCollection = e.Tree.treeCollection.OrderByDescending(x => x.Text).ToList(); }
    
            }
  • Aaron Powell 1708 posts 3046 karma points c-trib
    Oct 20, 2010 @ 00:02
    Aaron Powell
    0

    I did some stuff with manipulating the content tree nodes for my DDD Melbourne talk: http://www.aaron-powell.com/dddmelbourne-umbraco

    Note - it doesn't go as far as you're trying, and what you're doing would be a lot easier if you implemented a custom tree (you can override the content one)

Please Sign in or register to post replies

Write your reply to:

Draft