I've got a weird case where unpublished pages are showing up in the menu when I'm doing a preview of the frontpage of my site. How on earth is that happening when the page is completely unpublished?
I'm using the following piece of code to get the top level menu items:
The preview shows the latest version of all pages, including any unpublished pages. If that causes problems for things like menus, IsPublished() will tell you whether the page has a published version. So you might do something like this:
Unpublished pages showing up in preview
I've got a weird case where unpublished pages are showing up in the menu when I'm doing a preview of the frontpage of my site. How on earth is that happening when the page is completely unpublished?
I'm using the following piece of code to get the top level menu items:
The preview shows the latest version of all pages, including any unpublished pages. If that causes problems for things like menus,
IsPublished()
will tell you whether the page has a published version. So you might do something like this:is working on a reply...