Copied to clipboard

Flag this post as spam?

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


  • Hudhaifa Yoosuf 28 posts 97 karma points
    Apr 11, 2014 @ 06:55
    Hudhaifa Yoosuf
    0

    Sorting

    how to automatically sort a folder when a child is created under that folder 

  • Fuji Kusaka 2203 posts 4220 karma points
    Apr 11, 2014 @ 14:34
    Fuji Kusaka
    0

    Hi,

    In umbraco when a new node or media is created it is sorted in such a way that the last created content is at the bottom of the folder. 

    If you want to order them then you need to make use OrderBy("createDate desc") in razor .

     

  • Hudhaifa Yoosuf 28 posts 97 karma points
    Apr 14, 2014 @ 08:57
    Hudhaifa Yoosuf
    0

    can u give me a exapmle 

     

  • Peter Gregory 408 posts 1614 karma points MVP 3x admin c-trib
    Apr 14, 2014 @ 09:09
    Peter Gregory
    0

    Hey There.

    Fuji is referring to the actual rendering of content and not the back office. Sorting automatically in the back office is a harder than sorting during the render. Or if you are just looking for a UI solution look at sort option on the folder itself. There were some packages available for auto sorting for v4 but not sure they were updated. You can sort it based on the column headings but if thats not enough you would need to write content event to sort the back office documents. If you need a custom solution look into the info on writing content events found here http://our.umbraco.org/documentation/Reference/Events-v6/

    In the event you would need to look up the parent node and get sort order of each of its children and update the order accordingly based on where the new item is required to sit in the order, and republish them accordingly.

    Hopefully this gives you a starting point. Be aware that writing events is slightly different depending on version of Umbraco.

  • Hudhaifa Yoosuf 28 posts 97 karma points
    Apr 14, 2014 @ 13:18
    Hudhaifa Yoosuf
    0
  • Hudhaifa Yoosuf 28 posts 97 karma points
    Apr 14, 2014 @ 13:30
    Hudhaifa Yoosuf
    100

    these events are for umbraco functions right.. i want to sort a a folder which i have created

Please Sign in or register to post replies

Write your reply to:

Draft