Re: [SMARTY] Dreamweaver Users - How do you manage sites?
Gary Smith <[email protected]>
| Newsgroups | gmane.comp.php.smarty.general |
|---|---|
| Message-ID | <BF17B663.5561C%[email protected]> |
Aloha All, Thanks to everyone for their replies. Here is what I ended up doing. ~\htdocs <- Apache's document root ~\htdocs\index.html <- This is PHP ~\htdocs\assets\images <- This is where I put images ~\htdocs\assets\css\ <- This is where I put stylesheets ~\htdocs\assets\js\ <- This is where I put javascript ~\templates <- Dreamweaver's document root ~\templates\index.tpl <- This is my smarty template ~\templates\assets <- Symlink to ~\htdocs\assets I configure my testing server to parse .tpl files as SSI. Then I use SSI includes in my templates for template pieces such as header.tpl and footer.tpl. I then use ftp to upload my files to the remote server. Great combination! Gary in article 231b01c59429$4bfd0410$1fc70005@mark, "Mark Rogers" at [email protected] wrote on 7/29/05 12:35 AM: > Gary Smith wrote: >> What if I move my templates to a folder inside web root? How would I >> preview them locally and remote? > > For what its worth, this is how I've handled similar situations: > > ~\htdocs <- Apache's document root > ~\htdocs\index.php <- This is PHP > ~\templates <- Dreamweaver's document root > ~\templates\index.html <- This is HTML template > ~\templates\img\ <- This is where I put images > ~\templates\css\ <- This is where I put stylesheets > ~\templates\js\ <- This is where I put javascript > > (~ is just some directory on my web server under which all the site's files > are stored.) > > This means that using ~\templates as the document root the templates work > fine in (eg) Dreamweaver - image paths etc are fine. > > I then use aliases in the Apache config to map /img/ to ~\templates\img\, > etc, so that the site works when the PHP code is run (from Apache's document > root of ~\htdocs). > > Advantages: All the design stuff is separate from the code logic, so the > designer has complete control over the ~\templates directory. But it is all > outside document root, except for the specific img/js/css stuff which is > mapped back inside document root by Apache. > > On the occasions where I need dynamic css/js/img files (eg a stylesheet > which is generated through PHP and likely also through Smarty) I create > additional directories: > > ~\htdocs\dyncss <- Dynamic CSS (ie PHP code) > ~\templates\dyncss <- Templates for dynamic CSS > > .. etc. Therefore again there is separation between the work of the coder > and the designer. > > A general point: be VERY careful if you move your templates under document > root (by which I really mean don't do it). > > Consider: > ~\htdocs\index.php > ~\htdocs\templates\index.tpl > > It's obvious what http://example.com/index.php will show (ie your webpage, > presumably based on the index.tpl tenplate), but you must also recognise > that http://example.com/templates/index.tpl will allow the site visitor to > see your raw (unprocessed by Smarty or PHP) template code, which may well > include things you do not want made available. You can fix this through > appropriate Apache configuration, but in my view it's safer to avoid > altogether. > > [If you use a Linux/Unix server, as I do, then of-course all the \'s should > be /'s. However I think it's easier to distinguish between the file > structure and the URL's when they're written this way.] > > Mark Rogers, > More Solutions Ltd -- Smarty General Mailing List (http://smarty.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php