RE: [SMARTY] Re: Streamlining sites.
"George Pitcher" <[email protected]>
| Newsgroups | gmane.comp.php.smarty.general |
|---|---|
| Message-ID | <[email protected]> |
Pedro, I've gone for your suggested option which works fine, except that I am having problems getting fresh data to show when I move from page to page. For example, I have a list of packs containing reading material for courses. If I go into pack 1 (id=200) I see the articles for that pack. If I come out into the pack list and go into any other pack, I still see the articles for pack 1, regardless of the id. Each pack page should generate a fresh database query. I suspect that the template needs to be recompiled each time but can't be sure. Any ideas? Cheers George (knocking off for the day - back online at 0600GMT) > -----Original Message----- > From: Pedro [mailto:[email protected]] > Sent: 30 August 2005 11:54 am > To: [email protected] > Subject: [SMARTY] Re: Streamlining sites. > > > >>> site_templates_c > > $smarty already has a $compile_id var to help with this.. Thi smeans one > can have one shared compile dir across all sites > > http://smarty.php.net/manual/en/variable.compile.id.php > > > $smarty->compile_id = $_SERVER['SERVER_NAME']; > $smarty->compile_dir = 'path/to/shared_compile_dir'; > > This is really useful - particullarily when upgrading smarty > > Pedro > > > > George Pitcher wrote: > > Hi, > > > > I have five sites using the same code, apart from images and database > > connection. > > > > I wanted to set them up so that they share the code and a > config file sets > > up the individual bits. > > > > I'm currently on IIS so this is how I went about it. > > > > Set up a folder containing the php files. In that folder I have the > > following: > > > > folders > > --templates > > --images (contains common images used across all sites) > > and for each website > > --site_includes (contains config and image files) > > --site_templates_c > > --site_cache // added later > > --site_configs // added later > > > > For 'site' above, I replace with the virtual host name as used by IIS. > > > > I then set IIS to point the various virtual hosts to that main > folder and > > the home.php checks the 'ORIG_PATH' to know which site it is in and then > > calls the appropriate site_includes folder and stores the 'site' in a > > cookie. > > > > Initially, I figured that the individual site_templates_C would keep the > > data from mixing across sites but that didn't work and I had > images failing > > to display correctly and data traversing across the sites. I > then created > > individual site_cache and site_configs folders for each site > and that seems > > to be working fine. > > > > This might help someone else out the wanting to do something > similar with > > Smarty. I'm not sure how this works with Apache, but As I'm migrating to > > Apache2 (win2003) in the new year, I'm going to find out. > > > > Cheers > > > > George > > -- > Smarty General Mailing List (http://smarty.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php > > -- Smarty General Mailing List (http://smarty.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php