views:

320

answers:

6

I have to build a html website, which will contain about 50+ pages. The whole website will have a common look and feel. I wanted to know if there is a provision of master templates in building html websites, so that like in asp.net i can make a master page and then build html pages deriving from the master page. That way if i have to add a new link or change in the page layout i will not have to edit 50+ html pages. Any help? I can use Dreamweaver CS3 or Expression Studio 2.

I will rephrase

I have worked with ASP.NET and Master Pages and i know HTML is Static and ASP is dynamic (server side). I loved the ease which Master Pages provided, and since my hosting supports only HTML so i had to downgrade myself, and that is when i felt the need of having a wizard which can handle all the pages and update them if i make any change in the default page's layout.

Thus i cannot use serverside includes because i am not sure if my webserver supports it. Any other alternative, if it is dreamweaver can you tell me which feature exactly is it. Is it possible in expression web 2 too as well?

A: 

Well you can do one of two ways. Either use a little bit of PHP (or ASP etc) to include parts of the page you use most often. Or, in Dreamweaver you can create site templates, that when you alter filter through all other pages in the project. You can lock certain sections off so that you don't alter them accidentally when working on other pages.

Mizu
A: 

Sorry, but no. The concept of master pages (as seen in ASP.NET) is a server side solution. What the ASP.NET runtime does is it takes both the master page and the content page and merges them into a single page which then gets fed to the browser.

You could place an IFrame in the main page, however and put the content pages in that IFrame. You will then have to load the subsequent pages in the IFrame when the user navigates your menus, etc. Your content pages will have to reference all the necessary CSS and JavaScript as well. The IFrame may also pose problems when you try to display some overlay dialogs, etc. In overall, I don't think it's a good idea.

Pawel Krakowiak
Iframes also cause problems with bookmarking, linking, saving, printing and search engines. Using them for the purpose you describe is an awful idea.
David Dorward
@David: I agree. I try to avoid IFrames generally. I wrote about IFrames as it was the only idea of "HTML master pages" without a server side technology that I could think of. I never said it was a good idea, quite the contrary. :)
Pawel Krakowiak
+3  A: 

Here is a tutorial from Chris Leeds on using Expression Web 2 to achieve a similar result using Dynamic Web Templates.

http://expression.microsoft.com/en-us/dd566132.aspx

Rhys Jones
could you please confirm if dwt files can be used on simple webservers capable of showing static html web pages.
Anirudh Goel
From the Chris's tutorial - "Because the DWT method is server agnostic, meaning that no matter what kind of server your site is hosted on, you’ll be able to use the DWT, and that it has become a well refined technology, I recommend the DWT as a 'first choice' for template systems on most websites."
Rhys Jones
A: 

HI there:

I cant believe noone mentioned webby, webby is a really simple way to render html (or pdf, other text based formats) based on a template

From webby main site: "Webby works by combining the contents of a page with a layout to produce HTML. The layout contains everything common to all the pages – HTML headers, navigation menu, footer, etc. – and the page contains just the information for that page. You can use your favorite markup language to write your pages; Webby supports quite a few."

You need a bit of ruby goodness but well worth it!

You can even render the pages and put them up in google app engine for free And if you are using it, use the autobuild feature

Miau
A: 

http://allmyfaqs.net/faq.pl?Include_one_file_in_another summarises the various approaches to templating available for HTML, along with their pros and cons.

For a site that needs to reside on a server without any server side processing capabilities I would (after suggesting you upgrade to better hosting) recommend using TTree for offline processing of templates.

David Dorward
A: 

I highly recommend Dreamweaver templates. The output is static HTML and will work on any server: http://kb2.adobe.com/cps/138/tn_13876.html

apathetic