Watching:

Creating and using templates


show more Creating and using templates provides you with in-depth training on Developer. Taught by Bill Weinman as part of the XHTML and HTML Essential Training show less
please wait ...

Creating and using templates

So now that we've covered this structure of the XHTML document, and you know what all this stuff is that's required in every document, I know you're not going to want to type it every time and neither am I. I'm a big fan of lazy. So what I do is I keep around templates. Now as a starting point, I have this transitional-xhtml-template, which I actually use every time I'm doing to build a new document from scratch, and I start with this. It's got all the stuff that's required. It's got a placeholder for my document title, has a placeholder for where I start typing in my content.

Once I've designed a site, like for instance this one here. This is a site that we'll be using later on in the course to show how we do layout in a complete site. And this is the template for it. After I've designed the site and I've built the front page, I tear out the content and I create a template that's got just all the elements that are going to be consistent across the website. And down here I've got placeholders. Here's where my main content goes, here's where my sidebar content goes, here's where the title goes, and the rest of it is just constant.

So here's what it looks like in the browser. This is my little transitional template. This is the template for the website that we'll be looking at in more detail later on in the course. And here's the place for the main content. Here's the place for the sidebar content. I don't have type any of this anymore. Like I said, I'm a big fan of lazy. This is something that you can do to make to make it possible to use well structured documents that are correct and that will work well in a variety of browsers, and in a variety of media, and without really anymore effort than you would put into just the designing the things once.

No more effort really than it would be just to use plain old ugly HTML, to be able use well formed XHTML that will work across platforms and well into the future on all kinds of new devices. So use your templates. Become a fan of the lazy.

Creating and using templates
Video duration: 1m 49s 4h 44m Beginner

Viewers:

Creating and using templates provides you with in-depth training on Developer. Taught by Bill Weinman as part of the XHTML and HTML Essential Training

Subjects:
Developer Web
Software:
HTML XHTML
Author:
please wait ...