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.
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.
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
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.
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
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:
And I would like to choose between something like this:
And this:
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
Thank you for your response Dirk,but I'm talking about the back end. So like this:
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
Hm ok... I hoped there was a function for this in Umbraco. But ok, thanks. I'll try to build something myself :-)
The project I posted above is made for what you are trying to achieve http://our.umbraco.org/projects/developer-tools/autofolders
Rich
is working on a reply...