Forum
Make hidden page inaccessible by direct link
Hi there.
My client wants to make a page inaccessible temporarily. He has hidden it from the navigation group, but doesn't want it to be viewable via a direct link either.
Is there any way to do this without deleting the page? Deleting the page would be a little annoying because when he needs to use it again, he'll have to enter the content again.
Thanks.
Perch doesn't have anything magic built in for this precise scenario, no.
You can certainly create a system to do that using page attributes.
Can you give me a clue as to how I might do that please?
Set up a page attribute to say whether or not the page is viewable.
At the top of the page (or in your top layout or similar) test for the attribute. If the page isn't viewable, us
PerchSystem::redirect()
to redirect away to a different page.