Re: [SMARTY] Problems with {include} and a changing template dir
| From: | Håvard Lindset | Date: | Wed, 28 Aug 2002 18:43:35 +0000 |
| Subject: | Re: [SMARTY] Problems with {include} and a changing template dir | ||
| References: | 1 | Groups: | php.smarty.general |
| Request: | Send a blank email to php-smarty-general+get-5857@lists.php.net to get a copy of this message | ||
Thanks for the reply, Gary.
Yup. They're in the same directory as index.tpl
Best regards,
Håvard Lindset
lindset@webpixels.net
----- Original Message -----
From: <gary@loescher.org>
To: <elindset@hoved.net>; <smarty-general@lists.php.net>
Sent: Wednesday, August 28, 2002 8:39 PM
Subject: RE: [SMARTY] Problems with {include} and a changing template dir
> This may be a silly question, but I'm assuming that
> the templates header.tpl and footer.tpl are also in
> the "blue" directory?
>
> Gary
>
> >>-----Original Message-----
> >>From: Håvard Lindset [mailto:elindset@hoved.net]
> >>Sent: Wednesday, August 28, 2002 12:27 PM
> >>To: smarty-general@lists.php.net
> >>Subject: [SMARTY] Problems with {include} and a
> >>changing template dir
> >>
> >>
> >>Hi,
> >>
> >>I'm experiencing problems when I'm using {include} in
> >>templates. It was working before when the templates
> >>were under the hardcoded and default directory
> >>'templates'. Right now I'm loading the template name
> >>from a database (so it's possible to change template
> >>fast). If I for example have selected a template named
> >>'blue', the template directory would be '/templates/blue'
> >>
> >>Here is the code I'm using (there is of course more
> >>code, but I've removed it to improve the readability):
> >>
> >>---
> >>
> >>index.php
> >>
> >>$smarty->template_dir = "templates/" . $template_name;
> >>
> >>[...]
> >>
> >>$smarty->display("index.tpl");
> >>
> >>---
> >>
> >>templates/blue/index.tpl:
> >>
> >>{include file="header.tpl"}
> >>
> >> [...]
> >>
> >>{include file="footer.tpl"}
> >>
> >>---
> >>
> >>What happens is that the files header.tpl and
> >>footer.tpl aren't included. Does anyone have the
> >>slightest idea why they aren't? The value retrieved
> >>from the database is OK, so that's not the problem.
> >>
> >>Best regards,
> >>Håvard Lindset
> >>lindset@webpixels.net
> >>
>
>
> --
> Smarty General Mailing List (http://smarty.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>