Copied to clipboard

Flag this post as spam?

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


  • Rasmus Lynggaard 118 posts 325 karma points
    Apr 17, 2009 @ 15:32
    Rasmus Lynggaard
    0

    How do I get published date in XSLT

    Hi I'm creating a news list and would really like to sort by and display published date instead of createdate, since newsitems often are written before they are published.

    Is that and how is that possible?

    /Rasmus

  • Jan Skovgaard 11280 posts 23678 karma points MVP 11x admin c-trib
    Apr 17, 2009 @ 16:04
    Jan Skovgaard
    0

    Hi Rasmus

    I think the best solution would be to add a field date field w. time on your news document type and make a sort on that value.

    If you don't want to select the date manually every-time you make a news entry you could probably create a action-handler to do it for you automatically.

  • Niels Hartvig 1951 posts 2391 karma points c-trib
    Apr 17, 2009 @ 16:09
    Niels Hartvig
    0

    There's a property called UpdateDate - that might be what you're looking for?

    A part from that I agree with Jasko that the best solution is to add a property for the news release date as you might not want it to change everytime someone publishes the doc

  • dandrayne 1138 posts 2262 karma points
    Apr 17, 2009 @ 16:56
    dandrayne
    0

    To add to this, when I do this the client inevitably wants to archive news as well, so creating a property for PublishDate and ArchiveDate helps a lot, then in the xslt we can do something like


    [code]



  • dandrayne 1138 posts 2262 karma points
    Apr 17, 2009 @ 16:57
    dandrayne
    0

    oh, and something like this for sort

    [code]

    [/code]

  • Rasmus Lynggaard 118 posts 325 karma points
    Apr 17, 2009 @ 16:58
    Rasmus Lynggaard
    0

    Oh that sure sounds as the way to go.
    A date field that automatically gets the date of the publishdate, via actionhandler, but only if the field is empty.

    Thx

Please Sign in or register to post replies

Write your reply to:

Draft