Copied to clipboard

Flag this post as spam?

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


  • How Do I Delete My Account? 68 posts 433 karma points
    Aug 09, 2015 @ 12:49
    How Do I Delete My Account?
    0

    Get published nodes/pages in the order they were published

    I'm currently struggling with this and I can't seem to find documentation on it either.

    I have a couple of unpublished articles on my site that I keep for editing, future publishing etc. The thing is that I want to order them on my site in the time they were published.

    I currently use this line of code: var selection = CurrentPage.Site().FirstChild("news").Children("articles").Where("Visible").OrderBy("CreateDate desc");

    As you can see. They're ordered by the date they were created. However. I would like to order them by the date/time they were published.

  • Steve Morgan 1349 posts 4458 karma points c-trib
    Aug 09, 2015 @ 14:45
    Steve Morgan
    100

    Use UpdateDate instead of CreateDate but note that if you / users update the content then the UpdateDate will be the last datetime of publish.

    I'd suggest that you add a Date Time picker to your article which allows the user to set a publish date for display / sorting.

    There's a discussion here: http://stackoverflow.com/questions/20940740/umbraco-7-how-do-i-get-the-published-date-from-ipublishedcontent

  • How Do I Delete My Account? 68 posts 433 karma points
    Aug 10, 2015 @ 09:50
    How Do I Delete My Account?
    0

    I figured that's what I had to do. Thx for your answer :)

Please Sign in or register to post replies

Write your reply to:

Draft