views:

21

answers:

2

Hello, Let's say you want to work with a lot of parters and customize your website for them. The constraints are

  1. they want to have their own
    • HEAD-information (javascript, css, sometimes title & meta)
    • body header
    • body columns (right or left)
    • body footer
  2. they want to be able to modify header/footer often
  3. iframe is not an option

what would be a good way to do that ?

Thank you

A: 

Well, my question to you is, is the web content dynamic? If they are fairly static, perhaps you should look into CMS tool, such as Mediawiki, Drupal, Wordpress, etc. This way, you can change the skin easily for each group without touching the content. That said, you can put dynamic stuff in the CMS... ex: in my case, I wrote my own php plugin for mediawiki to pull dynamic content into it for my company... but, it's not that straightforward compared to writing your own web app. I administer mediawiki and drupal for my work group, and right now, I'm experimenting alfresco to see if that serves my user needs.

limc
+1  A: 

Have you considered a template engine? The MVC (model-view-controller) pattern, sometimes also called view-model-template, is quite popular along web projects. Assuming a good template engine (you haven't mentioned a technology, so i can't recommend a specific one), it will be possible to inherit from templates and override or extend those blocks you want to change. So it will be easy to modify any block (e.g. header/footer/content/sidebar/...) you want. The layout is completely separated from the controller behind.

Those template engines I know all have a configurable load-path for their templates. So one good solution might be to create separate folders for each individual layout and add one of them (depending on the request) in front of the default load path. If there is a template in the individual-layout folder it will be used (which might then extend the default one), otherwise the default template will be used. But the concept might differ, depending on the template engine you use.

If you really want to only add headers and footers, something likes Apache's mod_layout might suit you, but it seems not to be very popular anymore and you might exceed its limits soon. Unique web designs has become more important over the last years, and just changing the header is often not enough anymore. So, the best-practice is in my opinion clearly a good template engine.

tux21b
the language is PHP. would you recommend a specific template engine ?
Jerome WAGNER