Re: [SMARTY] Another Newbie Question
| From: | Jason Sweat | Date: | Fri, 04 Oct 2002 00:55:07 +0000 |
| Subject: | Re: [SMARTY] Another Newbie Question | ||
| References: | 1 | Groups: | php.smarty.general |
| Request: | Send a blank email to php-smarty-general+get-6094@lists.php.net to get a copy of this message | ||
Read up on the section on caching. You will need to specify a cache_id for
the template. You could do one per browser, or per style sheet, whatever
you like. Smarty will cache one version of the template for each cache_id
you specify.
Jason
----- Original Message -----
From: "Rich Gray" <richardgray@onetel.co.uk>
To: "Mitch Vincent" <mitch@unixprogramming.net>
Cc: "Smarty-General@Lists. Php. Net" <smarty-general@lists.php.net>
Sent: Friday, October 04, 2002 2:23 AM
Subject: RE: [SMARTY] Another Newbie Question
> Yes that is what is what I am doing but doesn't Smarty just run the
compiled
> (or cached if switched on) version if the template is unchanged
> (structurally)?
> If yes then as the template hasn't changed between visitors then the wrong
> users may get the IE css stylesheet...
>
> e.g.
>
> user A (IE) arrives...
> Smarty compiles header.tpl with {$iecss} set to '<link rel="stylesheet"
> type="text/css" href="css/ie.css" />'
> user B (Opera) arrives...
>
> Will Smarty recompile header.tpl with {$iecss} set to a null value then
> recompile it again when Mr IE user hits another page?
>
> If yes then Smarty will recompile a template if a variable changes so the
> compiled template will continually flip between IE and non IE users - is
> that right?
>
> Or am I being particularly dense today ... probably
>
> Rich
>
> -----Original Message-----
> From: Mitch Vincent [mailto:mitch@unixprogramming.net]
> Sent: 03 October 2002 15:34
> To: Rich Gray
> Subject: Re: [SMARTY] Another Newbie Question
>
>
> Use a template variable for the style sheet source and set that
> depending on what browser visits the page..
>
> On Thursday, October 3, 2002, at 11:16 PM, Rich Gray wrote:
>
> > Hi all
> >
> > Another very basic question here...
> >
> > Smarty v2.3.0
> > PHP v4.2.3
> > Win2K Advanced Server
> > Apache v1.3
> >
> > I have a header template that is used for most pages. With this site
> > the PHP
> > script sniffs the browser and if it is an IE version it will insert
> > another
> > style/CSS stylesheet HTML <head> line into the header template...
> >
> > So how does this scenario work with Smarty?
> >
> > i.e. Template is built and compiled by the first visitor (A) who uses
> > Mozilla so no stylesheet code is inserted, visitor (B) with IE arrives
> > shortly afterwards and Smarty recompiles the header with the extra
> > stylesheet... then visitor A goes to another page and now gets an IE
> > CSS
> > header???
> >
> > TIA
> > RIch
> >
> >
> > --
> > Smarty General Mailing List (http://smarty.php.net/)
> > To unsubscribe, visit: http://www.php.net/unsub.php
> >
> >
> >
>
> -Mitch
>
> Any sufficiently advanced technology is indistinguishable from magic.
>
>
> --
> Smarty General Mailing List (http://smarty.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>