what is the best case to achieve the following:
I want to set some pages as hidden as i am writing the content, but i want to display a preview.
I dont want to use the preview Plugin i found here, as i am using 100% width of the browser and i need to see how the choosen page reacts.
So, how do i get the current logged in Panel User and check if he is an admin?
If the clause is fault i could redirect to the 404 Page.
That’s perfectly fine. If you don’t want these pages to be permanently hidden, you might use a field in your page instead to check if the page is published or not and react on that, so that later you don’t have to change the template but only the field value. Depends on your use case.
Why does this not work for me?
I do as Sonja suggests, but the code in the if statement is executed (and content shown) whether I am logged in or not.
What am I not getting?