Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Webpage Template Generated At Runtime

Status
Not open for further replies.

cbjroms

IS-IT--Management
Dec 7, 2004
7
GB
My website was developed for me some years ago and is currently being rewritten by another developer.

One of the features of the website is that I can alter the layout of the pages using 'switches' in my Content Management System. These 'switches' typically allow me to swtich images on/off, alter their size and select whether text is shown to left, right, above or below the images.

My current developer has advised me that:

'there is no HTML document at design time, the HTML in it's complete form only gets generated at runtime. If you look at CMmod_main.ascx.vb you'll see that various fragments of HTML are being added to the page at various points throughout the server side code (inside if statements etc).'

He goes on to say that:

'it's extremely difficult to maintain, extend or debug in the future.'

So my question is what is the most efficient way to generate, based upon the 'switches' already contained within an sql database, webpages at runtime?

I have done a great deal of research on the internet and cannot believe that my requirement is unique. But I have been able to find little relevant information. The most promising solution, so far, seems to be an article ( which deals with email templates.

I would be very grateful for some advice please.

Chris
 
it's all about encapsulation and responsibility. if this is done correctly then you can have the option to configure layout. if it's done poorly, it's very difficult to maintain.

layout is about presentation with web applications presentation should be controlled by CSS (cascading style sheets). this is purely an html issue that is not specific to webforms.

now, webforms does have an implementation to mange this: Skins and Themes. controls are assigned a Skin and skins can be defined in a theme. you can then select the theme at runtime. because this approach is webforms specific you *can* use the web server control formatting option. I wouldn't though, if you switch to a different html engine the themeing (specific to webforms) is lost and you will need to switch over to CSS anyway.

then you have theming on the CSS side. jquery has an implementation of this called themeroller.

webforms produces some horrendous html so using a client side themeing engine with webforms may prove difficult at best. if you are rewriting the application using an MVC framework and controlling the html yourself, then a client side themeing framework will work better.

now, will it work exactly the same as your current model? that depends on how the current system was designed. I would anticipate that there will be some change between your current model and the new themeing model.

I would also suggest researching the concept of convention over configuration. this will make a huge difference in managing the customization options. if you can standardize formatting then configuring user preferences becomes much easier.

Jason Meckley
Programmer
Specialty Bakers, Inc.

faq855-7190
faq732-7259
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top