How to make the content page to render different template accordingly
Hi,
I have a content page 'contact us'.User will be loggin in as 'admin' or normal user. What i want to achieve is i want the 'contact us' page to use different template say 'adminContactTemplate' for 'admin' user and 'ContactTemplate' for normal user. Any one kindly point me in the right direction.
How to make the content page to render different template accordingly
Hi,
I have a content page 'contact us'.User will be loggin in as 'admin' or normal user. What i want to achieve is i want the 'contact us' page to use different template say 'adminContactTemplate' for 'admin' user and 'ContactTemplate' for normal user. Any one kindly point me in the right direction.
With regards,
Rain
Which version of Umbraco? WebForms or MVC?
The umbraco version i'm using is 4.7.1.1
You will want to read http://issues.umbraco.org/issue/U4-1149 and also http://our.umbraco.org/forum/developers/api-questions/36211-Setting-the-Masterpage-via-code-in-410 -- you create a global.asax class that handles the HandleAfterRequestInit event and changes the template. Based upon the current user, if you want. Look into the forums for more help about how to access users.
See an example there: https://github.com/umbraco/OurUmbraco/blob/master/uForum/ForumChangeTemplate.cs
Stephan
is working on a reply...