CSS can't help factor out the "boiler-plate" text that surrounds the actual data (e.g. the word "Price:" to the left of a product price). CSS doesn't have conditionals, so I can't do things like make the price print out in red if it's less than $20. CSS can't do loops, so I can't print out the first three related products. (I could have my main program limit the list to 3, but then if that requirement changes to show 5 instead, I would have to change it in my program.) The list goes on. CSS can only change the appearance, not the actual structure of the page. In short, CSS isn't powerful enough to completely remove knowledge of the page layout from your program, but templates are.

In reply to Re: Why use templates? by perrin
in thread Why use templates? by BUU

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.