Copied to clipboard

Flag this post as spam?

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


  • Rick 31 posts 81 karma points
    Jun 23, 2011 @ 08:01
    Rick
    0

    Order page tree by custom property

    I've created my own document type 'News'. I used this in de the content tree and added a few sub pages, containing news items. But I can't figure out in which way they are ordered now. It's not alphabetically and not by creation date.

    However, I would like to order them by my own property 'OriginalDate'. I'm searching for this now quite a while, but I can't figure it out. Anyone any ideas? Thanks.

     

  • Rich Green 2246 posts 4008 karma points
    Jun 23, 2011 @ 08:56
    Rich Green
    0

    Hi Rick,

    You might need to expand your question a little. Are you talking about sorting the news posts in the back end or front end?

    In the back end the sorting automatically defaults to when you add a node, for automatic sorting you may want to look at http://our.umbraco.org/projects/developer-tools/autofolders

    Regards

    Rich

     

  • Rick 31 posts 81 karma points
    Jun 23, 2011 @ 09:10
    Rick
    0

    Sorry, when talking about the content tree, I mean the content tree in the back end.

    Thank you for your suggestion, but that way I will get a structure like this:

    • 2010
      • 01
        • a-item
        • b-item
      • 02
        • a-another-item
        • b-another-item

    And I would like to choose between something like this:

    • a-item
    • a-another-item
    • b-another-item
    • b-item

    And this:

    • a-item (2011-06-20)
    • b-item (2011-06-18)
    • a-another-item (2011-06-15)
    • b-another-item (2011-06-10)
  • Dirk De Grave 4541 posts 6021 karma points MVP 3x admin c-trib
    Jun 23, 2011 @ 09:46
    Dirk De Grave
    0

    Rick, 

    Do you have any code in xslt? or Razor? It's much easier if you could show what you've got already and work out a solution from there.

    In xslt, you could use the <xsl:sort> statement, whereas in Razor, you'd use .OrderBy("propertyAlias ascending|descending"). Anyway, show us some code and we will help you out.

    Cheers,

    /Dirk

  • Rick 31 posts 81 karma points
    Jun 23, 2011 @ 10:20
    Rick
    0

    Thank you for your response Dirk,but I'm talking about the back end. So like this:

  • Dirk De Grave 4541 posts 6021 karma points MVP 3x admin c-trib
    Jun 23, 2011 @ 10:23
    Dirk De Grave
    0

    Oh, you mean you want your own "sorting" mechanism for any news item document that is being created in the backoffice. In that case, I think the autofolders project is provider model based, so you should be able to plug in your own "sorting" provider mechanism. It would require some coding, but it will be possible

     

    Cheers,

    /Dirk

  • Rick 31 posts 81 karma points
    Jun 23, 2011 @ 11:00
    Rick
    0

    Hm ok... I hoped there was a function for this in Umbraco. But ok, thanks. I'll try to build something myself :-)

     

  • Rich Green 2246 posts 4008 karma points
    Jun 23, 2011 @ 11:02
    Rich Green
    0

    The project I posted above is made for what you are trying to achieve http://our.umbraco.org/projects/developer-tools/autofolders

    Rich

Please Sign in or register to post replies

Write your reply to:

Draft