This project is read-only.

Un-Published Pages are Visible

Topics: Developer Forum, Project Management Forum, User Forum
Dec 9, 2008 at 4:24 PM
Hi,

I am trying to wrap my head around "Save without publishing" feature. I created a new page, and saved it without publishing. When the hierarchical tree refreshes the un-published page shows up in red, with a little grey down triangle. 

Then I open a new browser window and type in the URL for the un-published page and the page loads up. Also, as another test, I created a link to the un-published page in another published page. When the link is clicked, the un-published page shows up. Is there something that I am missing. I would expect the page to not show up and give a 404 not found error in both situations. 

Also as a possible enhancement request, if you import content under a non-published page, the pages which are imported should stay un-published as well, or function as un-published pages.

Thanks
Daniel
Dec 10, 2008 at 8:09 PM
Hi. What happens when you save a page without publishing is that it's inserted in the tree but it's publishing date isn't set. What you need to do in order to use filters when you retrieve the child list:

parent.GetChildren(); // Will retrieve the children you have access to, unless you're an editor you won't have access to pages that aren't published
parent.GetChildren(new NavigationFilter()); // Will retrieve pages that are published, not expired, visible and have permissions accessible to the current user

I'm not entirely convinced about the import thing. I like that they keep the status they had when exporting. If you filter the pages using the above this shouldn't matter.

Does this clear the picture?
Dec 11, 2008 at 4:02 PM
Christian,

I believe that I got it working. Now when I try to navigate to an un-published page, I am taken to a permission denied error page. But I have one further question. I did a test using the N2_TemplateSite and got a more desireable result. Here are the steps I performed.

1) Opened up the N2_TemplateSite in Visual Studio 2008 by clicking the MyProject-vs2008.sln
2) Ran the solution.
3) Logged into edit mode.
4) Created a new Text Page under the Home node called un-published-page.
5) Saved without publishing.
6) Refreshed the browser and saw the new Text Page node in the tree view.
7) I closed the browser.
8) Opened up a new browser and typed in the location to the unpublished page manually.
9) The un-published page did not display and I was redirected to http://localhost:60322/?returnUrl=%2fun-published-page.aspx

This redirect behavior is more desireable. How can I implement this.

Thanks
Daniel