I noticed that on our web-site when page has a Stop publish date set up and gets expired - it disappears from the menus but is still being shown if one know the direct link to it.
I tried to hide the content and show some kind of "Page is unnaccessible" message by using
if (!CurrentPage.CheckPublishedStatus(PagePublishedStatus.Published))
{
PageContent.Visible = false;
IfUnpublished.Visible = true;
}
It works fine, the only problem is that you cannot see the content in the preview when in EditMode as well.
So now I need to see if I'm in the EditMode or not. If I understand correctly, the RenderType class exists specifically for this purpose, but I couldn't find the way to use it properly in the master page template.
I noticed that on our web-site when page has a Stop publish date set up and gets expired - it disappears from the menus but is still being shown if one know the direct link to it.
I tried to hide the content and show some kind of "Page is unnaccessible" message by using
if (!CurrentPage.CheckPublishedStatus(PagePublishedStatus.Published)) { PageContent.Visible = false; IfUnpublished.Visible = true; }It works fine, the only problem is that you cannot see the content in the preview when in EditMode as well.
So now I need to see if I'm in the EditMode or not. If I understand correctly, the RenderType class exists specifically for this purpose, but I couldn't find the way to use it properly in the master page template.
Any ideas how I should have done this?
Thanx.