Portal Engine Questions on portal engine and web parts.
Version 5.x > Portal Engine > Making Documents display in date order in CMS tree. View modes: 
User avatar
Member
Member
David - 12/1/2010 10:20:28 AM
   
Making Documents display in date order in CMS tree.
It is very useful to have documents sorted in date order in the CMS tree.
However, if I use a date field for the document name, it takes the format DD-MM-YYYY which is sorted aphabetically which is not very useful.

Is there any way I can either
- Make the document name automatically take a date field, but formatted YYYYMMDD, or
- get CMS to display the documents in ascending date order.


User avatar
Kentico Consulting
Kentico Consulting
kentico_mirekr - 12/1/2010 11:30:36 AM
   
RE:Making Documents display in date order in CMS tree.
Hi,

You can use custom tree node handler (http://devnet.kentico.com/docs/devguide/customizing_the_administration.htm) for custom logic regarding the custom date document name.

You can also change the New document order option in CMS Site Manager -> Settings -> Select your web site -> Content management section and order new documents in different way.

Best regards,
Miroslav Remias.


User avatar
Member
Member
David - 12/1/2010 12:16:02 PM
   
RE:Making Documents display in date order in CMS tree.
Thanks for response.

Sorry - I did not make it clear - but I want to use a date which is not related to the date the document was created, or modified.

What date field is used for the sort if I change the New Document Order to First or Last? Is it the DocumentCreatedWhen field?

I also want to sort all existing documents which were not created in any logical order (but I am prepared to rename them)

Regards,

User avatar
Kentico Consulting
Kentico Consulting
kentico_mirekr - 12/3/2010 2:24:17 AM
   
RE:Making Documents display in date order in CMS tree.
Hi,

It seems to me that you have misunderstood point of New Document Order setting. This setting is applied ONLY when the new document is created and it means at what position (top, bottom or place as per alphabet) the new document should be placed in the section of content tree where you are adding this document. This means that NodeOrder (CMS_Tree table) is modified for such document and the document is moved into appropriate position in the content tree section. You can change the position of the document in content tree with UP and DOWN context menu buttons.

If you would change the way documents are ordered (not a problem) in the content tree then the default behavior of Kentico CMS (UP and DOWN context menu buttons) would lost its point. If you would click on Up/Down button, the document will not move up in the content tree since you removed NodeOrder ordering.

However, you can see how the documents are ordered in the content tree in ~\CMSModules\Content\Controls\ContentTree.ascx.cs file:

mMapProvider.OrderBy = "NodeOrder ASC, NodeName ASC, NodeAlias ASC";


In other words, we do not recommend you to change the way documents are ordered in the content tree since you would disable then "Up" and "Down" context menu actions.

It makes sense to order documents on live site in your menu navigation web part as you wish, but not to change the behavior or the content tree menu.

Hope this will point you to right direction.

Best regards,
Miro Remias.

User avatar
Member
Member
David - 12/6/2010 9:07:51 AM
   
RE:Making Documents display in date order in CMS tree.
Hi mirekr,

Thanks for the explanation - you have explained how it works, and why, and it makes more sense now.

Regards,

David

User avatar
Member
Member
andreycoman-yahoo - 11/10/2011 2:57:51 AM
   
RE:Making Documents display in date order in CMS tree.
Hi Miro,

I want to ask you if I can order documents in a repeater in the same way they are arranged in the content tree?

Best regards,
Andrei Coman

User avatar
Kentico Consulting
Kentico Consulting
kentico_mirekr - 11/10/2011 3:03:56 AM
   
RE:Making Documents display in date order in CMS tree.
Hi,

Sure, you can do that. Please take a look on this FAQ:

http://devnet.kentico.com/FAQs/Content-Management/How-to-ensure-same-order-of-items-as-in-CMSDesk.aspx

Thanks,
Miro

User avatar
Member
Member
andreycoman-yahoo - 11/10/2011 3:16:56 AM
   
RE:Making Documents display in date order in CMS tree.
Hi,
Thank you for your quick response.

Regards,
Andrei