Hi,
Templating for webpage creation is very important if you are building
a site over 10 pages or so, it is a huge time saver. I've never
created a site over five pages that didn't require some change to the
design, the menu, the buttons, or something. Templating allows you to
make changes to one area, and have those changes propagate through the
site. Much like the thinking behind CSS, which you say you are
familiar with.
As you can probably guess there are many ways to create a Templating
system for your site. The development of these methods has been a
necessity on the Internet since the beginning. Some of the methods
currently being used are more sophisticated than others. Some are very
simple, requiring very little time to put in place.
The simplest solution would be to use design programs such as
Macromedia's Dreamweaver. These design programs have built into them
templating systems that allow you to create content pages rapidly and
change templates for a site.
The main advantage to using a program like Dreamweaver is you don't
need to learn any thing else besides HTML and CSS. All of the pages
remain HTML and CSS basic pages, which means they won't have any
trouble with search engines indexing them.
If all you are looking for is a method to template the navigation
menus and some of the basic designs of the pages, and not anything of
a dynamic nature, then there are no disadvantages to using programs
like Dreamweaver. I suppose the only draw back would be a few hours of
study and a few days of experimenting until you understand the
Template creation and page creation methods for the program you
choose. Each one is a little different.
There is a method of templating, which relies on Frames or Framing (in
fact the reason framing was developed was a first stab at a easy
templating system for basic HTML). Framing has never worked very well,
for the navigation, the browsers or for the search engines. You can
also embed pages into HTML now, but again, it is not the best solution
for websites considering the problems with search engine indexing and
browsers, when there are better ways to go about it.
Your next step up on the "complexity" scale is JavaScript, which
allows you some flexibility in your templating methods.
Keep in mind that as you rise in complexity (meaning the hours you
will have to study to learn the system and maintain it) you also gain
a great deal in functionality. JavaScript is a great example of this.
With JavaScript, several template solutions present themselves. The
most basic is using JavaScript to load from a text file of XML file,
the menu systems and other areas of the page that remain the same.
JavaScript allows you the flexibility of programs like Dreamweaver,
with out spending the money on programs like Dreamweaver.
So, basically you put your menu HTML in a single file, and a
JavaScript tag in your HTML content pages. On loading of the page, the
JavaScript reads the text file and puts in the HTML from the file to
build your page.
Sounds simple, and it is. The disadvantage to using JavaScript is one:
you have to learn something about it, and two it doesn't work well
with search engines. Javascript needs to be executed by the browser,
not the server. So when search engine robots read the HTML files, they
generally do not execute the Javascript they find in the file (in fact
I'm sure none of them do, but I could be wrong as changes in this area
are constant).
Your next step is into the area of sever side scripting languages such
as PHP and Perl. For templating, PHP has the advantage over Perl for
simple templating. Perl does have some very sophisticated solutions
for templating, which I'm sure at this point are beyond your needs.
PHP is nice because you can start with very little, and do quite a lot
with it. Your ISP server has to have PHP available for you to use it
of course, but it is simple to get started with. In fact on the basic
level it is much like our JavaScript solution earlier. The difference
is that the PHP is being executed when the file is called, so search
engine bots always see the complete HTML for the pages, which the PHP
provides. In fact there is no sign to the bot that PHP was involved
(unless the page name has the extension of .php of course).
This simple method is called embedded PHP.
At the top of the food chain you have solutions such as Smarty;
monstrous template engines which do all kinds of things and will take
a few months of study time learning PHP and the template engines.
However, you can do just about anything with these template engines.
The sky is the limits here. Most of these abilities are beyond what
most people want however.
I personally love Smarty (on a programming level) but I rarely run
into a project these days that requires the level of sophistication it
offers. Most of the time I feel like Dreamweaver would have covered
it.
Links for Reference:
Dreamweaver Links:
Dreamweaver MX 2004 - Template Tutorial
http://www.lehigh.edu/~inimr/dreamtemp/
How to Create Dreamweaver Templates (PDF FILE)
http://www.mtholyoke.edu/help/creating-pages/style/pdf/templates.pdf
Dreamweaver Templates
http://www.mtholyoke.edu/lits/csit/documentation/dreamweaver/creating_templates/
Common questions about Dreamweaver
http://www.macromedia.com/cfusion/knowledgebase/index.cfm?id=tn_14714
Javascript Links:
Client-Side JavaScript Templates
http://www.fishwasher.com/jst/page1.html
The Code Project - Create Templates using Javascript
http://www.codeproject.com/jscript/jstemplete.asp
PHP Links:
PHP
http://www.php.net
Smarty
http://smarty.php.net
Perl Links:
Perl
http://www.cpan.org
HTML::Template
http://html-template.sourceforge.net/article.html
Other Links
HTML Toolbox
http://www.december.com/html/tech/tools.html
thanks,
webadept-ga |