views:

337

answers:

3

What is an elegant way to architecture an ASP.NET website in which end-users can create custom themes for their sites through a user interface?

Would ASP.NET themes help me here? Should the UI allow users to write guided CSS files to disc and apply those? Any suggestions are welcome. Thank you in advance.

+1  A: 

I would go with a CSS-only solution where users can specify their own CSS and only that to modify the theme and layout appearance.

You also need to be careful not to use tables as they are rigid and CSS can hit a wall with them.

Also have a look at CSSZenGarden to see how support user theming.

aleemb
A: 

First, build clean html templates with a strong approach on semantics, define a default css base which works well regardless of the theme chosen (basic element positions, basic images, font definitions, etc, etc.), and define your default theme in a separate file

Now there are two approaches:

Let them configure the look of some elements and store their preferences in the DB

http://acko.net/dev/farbtastic is a nice widget for choosing colors of elements If you want to go further, f.ex. drag&drop element positions on the layout, use f.ex http://jqueryui.com/ (or scriptcaluous or some other) and save their positions to db via httprequest on drop

Let them write their css file

If you'd like the approach of user writing a css file, I'd consider letting them override only specific classes of elements, but I don't know what you really want to achieve and how far you want to go with the theming, provide more details. I don't see why would they upload the css onto disk, simply put them in a textarea and save to the database.

Regardles of the way you choose, you should check how it works on http://tumblr.com or http://storytlr.com to get an idea on the subject.

zalew
A: 

man, ASP.Net themes are fine for small site, but for big sites, it is hell, you cant control your CSS includes and many other things, in my work i use themes only to define properties of controls, like setting CSSClass for textbox to "Tb", this is really great as it will apply to all textboxes, and you save your self a lot of time, and i stop there and wont define any CSS files in the themes.

then as JZ advised create a clean template that can be changed nicely like colors,font size, etc... and then create multiple css file to reflect your templates, then put a drop down box in your master page and fill it with templates names, then use jquery or add dynamic link, where it's value will change based on the drop down box selected value.

hope this helps.