How to reorder nodes, under a node with a special doc type in Content tree
I am making a calendar in the Umbraco content tree. I have made a node in the content tree with a doc type "Calendar", all nodes created under that node shall be orderet by a generic property "start date". I have been adviced too use an event for reordering the nodes in the content tree, but i havent been working with event's before, so here is my problem:
I have made the event "beforeNodeRender" and it is executed perfect, now the problem is to reorder the nodes under my doctype "Calendar". Can someone show me a little example of how to do that?
public void BaseTree_BeforeNodeRender(ref XmlTree sender, ref XmlTreeNode node, EventArgs e) { Log.Add(LogTypes.Custom, 1, "test From my event" ); }
How to reorder nodes, under a node with a special doc type in Content tree
I am making a calendar in the Umbraco content tree. I have made a node in the content tree with a doc type "Calendar", all nodes created under that node shall be orderet by a generic property "start date". I have been adviced too use an event for reordering the nodes in the content tree, but i havent been working with event's before, so here is my problem:
I have made the event "beforeNodeRender" and it is executed perfect, now the problem is to reorder the nodes under my doctype "Calendar". Can someone show me a little example of how to do that?
public void BaseTree_BeforeNodeRender(ref XmlTree sender, ref XmlTreeNode node, EventArgs e)
{
Log.Add(LogTypes.Custom, 1, "test From my event" );
}
Thanks in advance!
//Peter
Take a look into the packages with autofolders: Alphabetfolder, Autofolders, Datefolder)
If you are doing this by yourself: you can set the sortorder property in the after create event
hth, Thomas
Thanks for you reply!
Could you provide med with a little example?
// Peter
Peter,
There's some examples and how-to on the wiki pages/subpages here.
Hope this helps.
Regards,
/Dirk
is working on a reply...
This forum is in read-only mode while we transition to the new forum.
You can continue this topic on the new forum by tapping the "Continue discussion" link below.