Perl-Sensitive Sunglasses | |
PerlMonks |
Re: Why use templates?by ignatz (Vicar) |
on Apr 17, 2002 at 20:46 UTC ( [id://159992]=note: print w/replies, xml ) | Need Help?? |
A template is as useful as any other programming abstraction. It's a seperation of roles. Form from content. What is the same from what is different.
If you have your basic web page with it's standard parts (head, top navbar, body, bottom) why type these things over and over again? Templates add power and flexibility. If your company goes from DumbWebStartup.com to DumbB2BStartup.com all you have to do is change a few variables. Granted CSS does in many ways simplify things, but a complex web portal is more than just the color of the background. I generally seperate parts of a web site into content (nodes in PM), packaging (look and feel) and components (search boxes, nodelets, etc). Templates greatly facilitate the use of these parts by keeping each of them seperate. I can move my search box or my breadcrumb bar all over the place, or change the way it looks, or whatever, without worrying about how these changes will effect the content of my site. (Added) A programming design pattern that is used as a template for these sort of designs is the Model-View-Controller. ()-() \"/ ` `
In Section
Meditations
|
|