Need to automaticlly sort documents in the backend. Anyone done this? I thought of using an actionhandler and use the document.new event. If the document.new is of a certain type, get the parent and loop thru all children and set the sortOrder property and then use the save method? Or do I need to publish also to reflect changes to sortOrder in backend?
That package looks great. Can you specify a couple of documenttypes to be sorted? I need to sort at least 4 diffrent types, but dont want the rest of the document types to be sorted...
You have a number of options, you can define multiple rules for individual doc types, or you can define an xpath statement for the parent node and everything underneath will be sorted. Or a combination of the 2.
Let me know if you need any help configuring it for your needs.
Matt is it only 4.5 compatable? As I dont want to upgrade to 4.5 yet. Have to many custom controls that access the api's of Umbraco and extensive XSLT files. But many thanks for upgrading to create also!
If you only want to have them sorted at a UI-level or you're working with a large node set you can use some code which I showed in a recent presentation: http://www.aaron-powell.com/dddmelbourne-umbraco
It's then up to your code that's displaying them to re-apply the sorting. It does have the advantage of not being database intensive, but it is v4.5 only.
Sort documents in admin with api?
Need to automaticlly sort documents in the backend. Anyone done this? I thought of using an actionhandler and use the document.new event. If the document.new is of a certain type, get the parent and loop thru all children and set the sortOrder property and then use the save method? Or do I need to publish also to reflect changes to sortOrder in backend?
Give my package a try, should do the trick for you:
http://our.umbraco.org/projects/developer-tools/document-sorter
Can give you the source code if you are after something different.
Matt
Hi Matt.
That package looks great. Can you specify a couple of documenttypes to be sorted? I need to sort at least 4 diffrent types, but dont want the rest of the document types to be sorted...
Hi Andres,
You have a number of options, you can define multiple rules for individual doc types, or you can define an xpath statement for the parent node and everything underneath will be sorted. Or a combination of the 2.
Let me know if you need any help configuring it for your needs.
Matt
Installed it, but it seam to sort before publish event? Looks very confusing for the user that way. Can one do it after create?
Hmm, it currently reorders on save or on publish. I'll try and have a go and see what happens if I get it to sort on create.
Matt
Hey Anders,
I've done an update, and it looks to work on my version. Give it a try and let me know if you have any problems:
http://our.umbraco.org/projects/developer-tools/document-sorter
You'll want to download v1.2.0 which is also umbraco v4.5 compatable.
Many thanks
Matt
Matt is it only 4.5 compatable? As I dont want to upgrade to 4.5 yet. Have to many custom controls that access the api's of Umbraco and extensive XSLT files. But many thanks for upgrading to create also!
Hey Anders. It should work for both.
Matt
Nice, will try it out then.
If you only want to have them sorted at a UI-level or you're working with a large node set you can use some code which I showed in a recent presentation: http://www.aaron-powell.com/dddmelbourne-umbraco
It's then up to your code that's displaying them to re-apply the sorting. It does have the advantage of not being database intensive, but it is v4.5 only.
is working on a reply...