Beefy Boxes and Bandwidth Generously Provided by pair Networks
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??


in reply to Why use templates?

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.

()-()
 \"/
  `                                                   ` 

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://159992]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others studying the Monastery: (7)
As of 2024-03-28 08:48 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found