|
|
 Rank: Enthusiast
Joined: 6/12/2007 Posts: 34 Location: Appleton, WI USA
|
I'd like to be able to restrict my navigation to documents that are greater than/equal (>=) publish at and less than (<) remove at date (from the Properties tab). That way I can publish pages in advance and simply have them start showing up on the site on the right day.
Ideally, I'd like to do this via XSLT but I don't see those values published in the data/umbraco.config xml file. The node gets published but it doesn't have any dates other than createDate and updateDate
If not XSLT, can someone give me a sample of how to get at those properties via the API with a NodeID. I'm thinking something like the umbraco.library.HasAccess() function. Perhaps like an IsViewable() that checks if a publish date is set and if so are we past/equal to it and then checks if a "remove at" date is set and if we're before it. I'm hoping something like this already exists, I just couldn't find anything like it in the API docs.
Thanks in advance, Jim
|
|
 Rank: Umbracoholic
Joined: 9/8/2006 Posts: 1,698 Location: KY, USA
|
It should be that only published pages will be picked up by your XSLT, so your macros should already work properly... showing only pages that are currently published. Before or after the publish dates, the pages are not published and therefore won't appear in your menus, search, sitemap, etc. I've not used the publish at and remove at fields much. Is there a problem with them? cheers, doug.
MVP 2007-2009 - Official Umbraco Trainer for North America - Percipient Studios
|
|
 Rank: Enthusiast
Joined: 6/12/2007 Posts: 34 Location: Appleton, WI USA
|
Yes, they do show up in the published XML (umbraco.config). I have a page that has publish at date of 1/20/08 and a remove at date of 1/25/08. The node shows up in data/umbraco.config and thus appears in my navigation even though it's only 1/18/08.
I would think it has to show up in the XML, but with dates to filter by. If it didn't publish in the XML, how would it magically appear when 1/20 arrives? Would I have to manually go publish it on that date?
Thanks for the blazing fast reply.:thumbup:
|
|
 Rank: Addict
Joined: 3/17/2008 Posts: 953 Location: Nyborg, Denmark
|
It's pretty unclear, but in order for the publish/remove dates to work you shouldn't publish, simply set the dates and hit save. When it's time umbraco will - magically - publish them.
We're aware that the workflow of this in unclear and it'll be updated for 3.1 to make it easier to understand how the publish/remove dates work (the thing is that half of people we ask think it's most logic to hit the publish button, while the other says "but hey - you don't publish it. So the solution is to have a "You hit save, but you've got remove/publish dates set. Do you want to activate the automated publishing YES/NO?" or "You hit publish, be aware that your document won't be published before xxxxx, because a publication date has been set).
Needless to say that the sentences above isn't the ones that will appear finally - we need someone with better English than me to write these ;-)
Cheers, Niels...
Jeeeez, did I really start this :-)
|
|
 Rank: Enthusiast
Joined: 6/12/2007 Posts: 34 Location: Appleton, WI USA
|
Bingo. That works. So I was forcing it to publish by hitting the publish button.
I guess I'd be in the "You hit publish, be aware that your document won't be published before xxxxx, because a publication date has been set" camp.
So is there something running on my site monitoring this all the time? What is the trigger for this publishing - since it does appear to be "user initiated?"
|
|
 Rank: Enthusiast
Joined: 6/12/2007 Posts: 34 Location: Appleton, WI USA
|
...does NOT appear to be user initiated.
|
|
 Rank: Addict
Joined: 7/19/2006 Posts: 790 Location: Århus, Denmark
|
Umbraco "pings" itself on a regular basis, and while doing so, it checks if any documents need (un)publishing, and if so, (un)publishes them :-)
|
|
Rank: Newbie
Joined: 12/11/2007 Posts: 3
|
Niels Hartvig wrote: It's pretty unclear, but in order for the publish/remove dates to work you shouldn't publish, simply set the dates and hit save. When it's time umbraco will - magically - publish them.
We're aware that the workflow of this in unclear and it'll be updated for 3.1 to make it easier to understand how the publish/remove dates work (the thing is that half of people we ask think it's most logic to hit the publish button, while the other says "but hey - you don't publish it. So the solution is to have a "You hit save, but you've got remove/publish dates set. Do you want to activate the automated publishing YES/NO?" or "You hit publish, be aware that your document won't be published before xxxxx, because a publication date has been set).
Needless to say that the sentences above isn't the ones that will appear finally - we need someone with better English than me to write these ;-)
Cheers, Niels...
Hi Niels! Unfortunately I can't get it to work. I've created my page which is not published. Saved it with the public at property set and then hit the publish button. Unfortunately the page appeared straight away on the website. What do I do wrong? Is this property parsed while generating XSLT in the 3.0.3 version? Thanks in advance, Kamil
|
|
 Rank: Addict
Joined: 7/19/2006 Posts: 790 Location: Århus, Denmark
|
Hi Kamil. As Niels writes, you should not hit the publish button, but the _save_ button. Hope this helps...
|
|
|
Guest |