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 ;/
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.
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...
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(); }
}
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)
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
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
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..
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.
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)
is working on a reply...