Copied to clipboard

Flag this post as spam?

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


  • Jukka-Pekka Keisala 90 posts 226 karma points
    Dec 29, 2009 @ 21:00
    Jukka-Pekka Keisala
    0

    How do I display "Publish at" field in the frontend?

    How do I display "Publish at" field in the frontend using XSLT?

    Seems like this field is nowhere to find in XML output of the node? 

  • Lee Kelleher 4020 posts 15802 karma points MVP 13x admin c-trib
    Dec 29, 2009 @ 21:23
    Lee Kelleher
    0

    Hi Jukka-Pekka,

    Unfortunately, the "Publish At" property is not stored in the XML cache, so is not available in the XSLT.

    More details here: http://forum.umbraco.org/yaf_postst3091_How-do-I-get-Publish-at-and-Remove-at-dates.aspx#41785

    At present, the only way would be to write an XSLT extension that would query the "cmsDocument" table (for the "releaseDate" column) in the database.

    Cheers, Lee.

  • Lee Kelleher 4020 posts 15802 karma points MVP 13x admin c-trib
    Dec 29, 2009 @ 21:24
    Lee Kelleher
    0
  • Morten Bock 1867 posts 2140 karma points MVP 2x admin c-trib
    Dec 29, 2009 @ 22:28
    Morten Bock
    1

    I don't think it would make much sense to use that date in the front end, since it is reset to nothing as soon as umbraco actually publishes the node. What is the scenario? I would probably rather go with a property on the document with a datepicker.

  • Jukka-Pekka Keisala 90 posts 226 karma points
    Dec 30, 2009 @ 10:15
    Jukka-Pekka Keisala
    0

    Oh, it is reset to nothing after publish? Then it is indeed useless in the frontend.

    I notice this when I was planning to start to port my old blogposts to blog4umbraco. Blog4Umbraco uses createdate which is wrong since I want my old posts show old date, so I put orginal publish date to publish at -field.

    I would image this would be useful also on any kind of news/pressrelease -pages where I could just use Publish date to say when press release was published.  

    I guess now I need to just add another datepicker on the datatemplate for workaround.

    Anyway, I don't see point why the field is reset to empty after the publish and why it is not shown in XML. Could someone please explain?

  • Morten Bock 1867 posts 2140 karma points MVP 2x admin c-trib
    Dec 30, 2009 @ 17:02
    Morten Bock
    1

    Well, the feature is as follows

    Part one
    1. Create a page and enter some content
    2. Select a "Publish At" date
    3. Save the page (Not Save&Publish)
    4. Wait till the selected time has passed
    5. The page is now published, and the Publish At date has been reset

    Part two
    6. Change the content of the page
    7. Set a new Publish At date
    8. Wait
    9. The changed content is now published

    In order for Part two to work, Umbraco needs to reset the Publish At date, so that it does not publish the page again and again and again, because the date has been passed.

    In your specific case, with importing blog posts, you may want to set the "create date" from code through the API. This is what I did when importing old blogposts into Umbraco.

    So the Publish At property is not meant to be used for presentation, but only for scheduling the publishing of a node. (That is why it is called "Publish At" and not "Published At".

  • Morten Bock 1867 posts 2140 karma points MVP 2x admin c-trib
    Dec 30, 2009 @ 17:08
    Morten Bock
    0

    If you want to take a look, I made a blogpost about importing posts from wordpress (note that I am not using Blog4Umbraco):

    http://www.mortenbock.dk/blog/2009/10/13/importing-wordpress-posts-to-umbraco.aspx

    Otherwise, take a look at richards UmbImport package, which should also be able to set the Create Date for you.

Please Sign in or register to post replies

Write your reply to:

Draft