1. The web site has a site menu and 5 key features.
2. Depending on the login user, the page content is different. For example:
If user1 logs in:
a. Show the site menu on the left.
b. Only show feature 1, 2, and 3 on the page (feature 1 is on top, feature 3 is in the middle, and feature 2 is at the bottom).
If user2 logs in:
a. Show the site menu on the right (not on the left like above).
b. Show all 5 features but feature 1 is shown at the very bottom.
If user3 logs in:
a. Show the site menu on the left.
b. Show feature 4 and 5 but they are shown side-by-side.
As you can see, the features are "fixed" but the pages are "dynamic". What is the best way to implement such a web site? Thank you.
divide the page in logical areas, and foreach user srore what to put in each area. Then on rendering each area as a function that display its contend by first consulting the user db.
dragon-fly99...
Member
5 Points
15 Posts
Different layout for each user ...
Jul 05, 2012 12:54 PM|LINK
Hi,
I have the following requirements for a web site:
1. The web site has a site menu and 5 key features.
2. Depending on the login user, the page content is different. For example:
If user1 logs in:
a. Show the site menu on the left.
b. Only show feature 1, 2, and 3 on the page (feature 1 is on top, feature 3 is in the middle, and feature 2 is at the bottom).
If user2 logs in:
a. Show the site menu on the right (not on the left like above).
b. Show all 5 features but feature 1 is shown at the very bottom.
If user3 logs in:
a. Show the site menu on the left.
b. Show feature 4 and 5 but they are shown side-by-side.
As you can see, the features are "fixed" but the pages are "dynamic". What is the best way to implement such a web site? Thank you.
francesco ab...
All-Star
20888 Points
3277 Posts
Re: Different layout for each user ...
Jul 05, 2012 01:01 PM|LINK
divide the page in logical areas, and foreach user srore what to put in each area. Then on rendering each area as a function that display its contend by first consulting the user db.
Mvc Controls Toolkit | Data Moving Plug-in Videos
BrockAllen
All-Star
27434 Points
4891 Posts
MVP
Re: Different layout for each user ...
Jul 05, 2012 01:38 PM|LINK
An option (but perhaps not the best solution) is that you can have conditional code in the _ViewStart.cshtml file:
@{ if (this.ViewContext.HttpContext.User.IsInRole("RoleOne")) { Layout = "~/Views/Shared/_Layout.cshtml"; } else { Layout = "~/Views/Shared/_Layout2.cshtml"; } }DevelopMentor | http://www.develop.com
thinktecture | http://www.thinktecture.com/
bruce (sqlwo...
All-Star
36644 Points
5432 Posts
Re: Different layout for each user ...
Jul 05, 2012 01:48 PM|LINK
dragon-fly99...
Member
5 Points
15 Posts
Re: Different layout for each user ...
Jul 11, 2012 11:28 AM|LINK
I'll look into your suggestions. Thank you all.