Press Ctrl / CMD + C to copy this to your clipboard.
This post will be reported to the moderators as potential spam to be looked at
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:
Model.Root().Children.Where(x => x.IsVisible()).ToArray();
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:
Model.Root().Children.Where(x => x.IsVisible() && x.IsPublished()).ToArray();
is working on a reply...
Write your reply to:
Image will be uploaded when post is submitted