Order Blogs by Datepicker property first, then createDate
Hi!
Using v6.1.2. I have created a blog and initially set them to be ordered by the node's createDate. In order to allow posts to be back-dated, a date-picker property, "datePublished" has been added to the doc type. Now, I'd like to order the posts based on datePublished first, then by createDate. Some of the example out there don't seem to be working. For example, using
Did you try .OrderBy("datePublished, createDate")?
That syntax worked with DynamicNode but I've not tried it with dynamic Mvc (CurrentPage) so I'm not sure if its supported or not, if not then you should be able to use the ThenBy method with a typed object, something like
Order Blogs by Datepicker property first, then createDate
Hi!
Using v6.1.2. I have created a blog and initially set them to be ordered by the node's createDate. In order to allow posts to be back-dated, a date-picker property, "datePublished" has been added to the doc type. Now, I'd like to order the posts based on datePublished first, then by createDate. Some of the example out there don't seem to be working. For example, using
gives me the "Object reference not set to an instance of an object" error. OrderBy("datePublished", "createDate") didn't seem to work either.
Any suggestions? Thanks in advance for the help!
Hi Phillip,
Did you try
.OrderBy("datePublished, createDate")
?That syntax worked with DynamicNode but I've not tried it with dynamic Mvc (CurrentPage) so I'm not sure if its supported or not, if not then you should be able to use the ThenBy method with a typed object, something like
Jeavon
The second option is what I needed. Thank you!
Cool, I just amended a tiny typo above x.createDate should be x.CreateDate
is working on a reply...