View Full Version : does css outdate the smarty template?
alphabetanatomy
08-12-2006, 02:16 AM
from what i understand about smarty templates, they're used for the purpose of separating content from design. how much further can smarty templates go than css with regard to flexibility and ease of use? in other words, really, is there any viable reason for learning about smarty templates if css is already understood fully?
felgall
08-12-2006, 04:14 AM
You use such templates to separate the HTML design out from the server side programming language processing that generates the content to fill that template. It is one layer further down in separating things than the one where CSS applies and so is completely unaffected by the separation provided by CSS.
Here is a 4 layer example (to keep things simple)
Layer 1. CSS = appearance and positioning
Layer 2. smarty template - semantic page structure in HTML
Layer 3. PHP or other server side language
Layer 4. mySQL database containing the actual content
A more complex web application (or one visited by millions of people each day) may in fact break things up into several further layers each of which should be kept separate in order to make the whole thing easier to maintain.
The split between layers 2 and 3 in the above example is the one that is not provided in an obvious way through the use of different language and smarty and similar templates make this split easier by providing a way to split the page structure from the program that plugs in the content. Layer 3 should contain pure programming code with no markup tags whatever as they should all be in layer 2.
vBulletin® v3.8.2, Copyright ©2000-2012, Jelsoft Enterprises Ltd.