Re: [SMARTY] include headers and footers

From: Date: Tue, 04 Feb 2003 18:04:39 +0000
Subject: Re: [SMARTY] include headers and footers
References: 1 2 3 4  Groups: php.smarty.general 
Request: Send a blank email to php-smarty-general+get-7517@lists.php.net to get a copy of this message
In my smarty templates, I didn't use the header and footer files, I just had the <html> and </html> tags in the template, etc. and it all works fine. My question is this: is there any reason I shouldn't be doing things this way? Is there any drawback to not using the header and footer files or was this just included in examples to show that you can include files if you desire? It's much easier for me to leave this code in the template file because I edit the templates in Dreamweaver. I know this is a bit of a boring Newb. question, but any input is appreciated! Thanks! the drawback comes when you have a lot of different templates, maybe for different sections of your site, and you want to change something in the header (the applied style-sheet for example). you have to touch and edit every template that contains the <head>-tag. if you just include header.tpl you have a central file you touch, and the change gets applied to every page on the site. have fun messju
Thanks for the quick responses, Messju, Michael, and Duke! I can see why most people would like to have the header and footer file, for easy and quick modification, (especially if you've got a site the size of Amazon or something like it) but just wanted to make sure that it wasn't going to cause me a problem if in some of the templates I just left the tags in the template instead of having the header and footer files. I just saw another example though that also left them in like I did, so I think it'll be fine. I do understand the benefits of using the include files though, it makes perfect sense, especially in the example of an applied style sheet. Thanks for the input, I appreciate it!!! -Desiree

« previous php.smarty.general (#7517) next »