Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Naorem Rainson 10 posts 30 karma points
    Feb 01, 2013 @ 06:27
    Naorem Rainson
    0

    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

  • Stephen 767 posts 2273 karma points c-trib
    Feb 01, 2013 @ 07:21
    Stephen
    0

    Which version of Umbraco? WebForms or MVC?

  • Naorem Rainson 10 posts 30 karma points
    Feb 01, 2013 @ 09:26
    Naorem Rainson
    0

    The umbraco version i'm using is 4.7.1.1

  • Stephen 767 posts 2273 karma points c-trib
    Feb 01, 2013 @ 12:48
    Stephen
    0

    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

  • This forum is in read-only mode while we transition to the new forum.

    You can continue this topic on the new forum by tapping the "Continue discussion" link below.

Please Sign in or register to post replies