I have created a page called ‘Projects’ with subpages that use a single template ‘project’.
All projects have a checkbox field for ‘privacy’, where true means that it is a private project.
Currently, I have all projects children with privacy true collected into a ‘Client’ page that asks for a login if the user is not logged in. However, the projects are still visible via their direct url.
What is the best method for redirecting to a login page if a non-logged in user tries to access the private project page, and redirect to it when logged in? Do I need to create a separate template specifically for private projects? Or can I work with the template I’m currently using for both.