开发者

Implementing layouts in a multi-tenant site

I'm after a bit of advice on how to handle a multi tenant site in ASP.NET from a UI perspective.

What I want to be able to offer is 开发者_如何学Pythona choice of layouts to the client i.e.

Layout 1: Navigation horizontal at the top. Search results in a table in the middle. Some text at the bottom.

Layout 2: Navigation vertical on the left. Some text in the middle. Search results at the bottom

Layout 3, Layout 4, Layout x etc...

Each element within the various layouts can differ too. For example, the search results might look like simple list in Layout 1, but will have a completely different look in Layout 2.

Once a client has decided on Layout x, I then need to apply their company identity to the layout by changing the colours, logos, etc...

So, any suggestions on what approach to use would be greatly appreciated.

Many thanks,

ETFairfax


I would probably do this by dynamically switching master pages depending upon the tenant. An example of how to do this is here.

E.g., within the action you can specify the master page:

view.MasterName = "MasterTwo";

Where possible (logos and colors), try to use style-sheets to control the look and feel, and reserve changes in the master page for actual functional differences.


Assuming the document structure is consistent, you can dynamically deliver various stylesheets to reskin the site, based on which "tenant's" page is being requested.

Well written CSS can vary the layout of a well written document structure.


Create ASP.Net template pages with different layouts and use config files to vend the various layouts depending on client preference. Have a library showcase that you can show your present and prospective clients which lets them choose. Note that these templates can vend not only different markup but different stylesheets and even different client-side scripts.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜