Can we assign page template to a page conditionally. for example if a user is logged in then "PageTemplate_1" should be used and if user is logged out "PageTemplate_2" should be used.
Well... 2 choices come to my mind:
Usually you do the opposite, you hide/show parts of the template (i.e. enable/disable zones/web parts etc) based on conditions using macros like {% CurrentUser.IsAuthenticated |(identity)GlobalAdministrator%}, secondly I don't think it is the right approach(read more).
{% CurrentUser.IsAuthenticated |(identity)GlobalAdministrator%}
Thanks for the reply Peter, actually I need to change the complete layout of page, including header/footer (master page), so thats why I was asking to change the template dynamically rather than part of template.
Thanks Peter. Really I also think that, redirection will be the best option.
Please, sign in to be able to submit a new answer.