It looks like the page hasn't been successfully unpublished at the Unpublished At date.
Can you check in the Umbraco backoffice to see if it has been unpublished ?
if the page has been successfully unpublished then it's details will not be in the Umbraco Xml Cache file, and so won't appear in node.Children
(regardless of the Where filter, which you have correct if hideFromNavigation is the alias of your property that shows and hides pages in navigation - incidentally there is an Umbraco convention, that says if you call the alias of this property umbracoNaviHide then you can query .Where("Visible") )
There may be a number of reasons why unpublished at isn't automatically unpublishing your item at the specified date/time.
or it may be your configuration preventing scheduled tasks from running, the trace log files in /app_data/logs should give some clues to the error if this is the case.
I suspect you're right. I've checked the node tree again in the admin section and I can see that the page status never changed to unpublish once the unpublish date had been reached.
If I manually unpublish the page, I can see my code works and the page is removed from the site map.
Hopefully Umbraco will come up with a fix soon.
Alternatively do you know what the alias name is on Unpublish At?
I can't seem to get this code to work - also I'm trying to make a conventional sitemap - i.e. one that shows indentations rather that a Google SiteMap which returns everything in a straight list.
Hiding unpublished pages
Hello,
I have a sitemap, which is still showing a page that should have been removed as the Unpublished At date was reached.
What criteria do I need to check for to make sure I filter out this page.
The code I have:
Thanks
Paul
Hi Paul
It looks like the page hasn't been successfully unpublished at the Unpublished At date.
Can you check in the Umbraco backoffice to see if it has been unpublished ?
if the page has been successfully unpublished then it's details will not be in the Umbraco Xml Cache file, and so won't appear in node.Children
(regardless of the Where filter, which you have correct if hideFromNavigation is the alias of your property that shows and hides pages in navigation - incidentally there is an Umbraco convention, that says if you call the alias of this property umbracoNaviHide then you can query .Where("Visible") )
There may be a number of reasons why unpublished at isn't automatically unpublishing your item at the specified date/time.
There is an open issue: http://issues.umbraco.org/issue/U4-5562
or it may be your configuration preventing scheduled tasks from running, the trace log files in /app_data/logs should give some clues to the error if this is the case.
regards
Marc
Hi Marc,
I suspect you're right. I've checked the node tree again in the admin section and I can see that the page status never changed to unpublish once the unpublish date had been reached.
If I manually unpublish the page, I can see my code works and the page is removed from the site map.
Hopefully Umbraco will come up with a fix soon.
Alternatively do you know what the alias name is on Unpublish At?
Thanks
Paul
Hi
I have checked this and it is fine here.
Manish
Hi Manish,
Thanks for your response.
I can't seem to get this code to work - also I'm trying to make a conventional sitemap - i.e. one that shows indentations rather that a Google SiteMap which returns everything in a straight list.
Thanks
Paul
Hi
Can you check in DB for the following nodes that they are in unpublished status.
Manish
Hi,
A note to add to this is when you put in a unpublish date you must press "save" NOT "save and publish"
Nav
is working on a reply...
This forum is in read-only mode while we transition to the new forum.
You can continue this topic on the new forum by tapping the "Continue discussion" link below.