RE: [SMARTY] problems with using paths in my templates
| From: | Peter Billen | Date: | Mon, 15 Jul 2002 22:04:40 +0000 |
| Subject: | RE: [SMARTY] problems with using paths in my templates | ||
| References: | 1 | Groups: | php.smarty.general |
| Request: | Send a blank email to php-smarty-general+get-5325@lists.php.net to get a copy of this message | ||
That IS a solution, but I hope there is something better...
I really want to give my visitors the opportunity to make templates
WITHOUT knowing the structure of my scripts/server/...
Peter
-----Original Message-----
From: Michal Prinke [mailto:bogien@conecto.pl]
Sent: maandag 15 juli 2002 23:53
To: Smarty
Subject: Re: [SMARTY] problems with using paths in my templates
Peter Billen wrote:
> So, this works:
> <img src="/templates/default/images/bla.jpg">
> but this doesn't
> <img src="images/bla.jpg">
I had the same problem, too... in my opinion, it would be clean and tidy
to keep Smarty templates together with graphics files, CCS' and stuff -
apart from PHP scripts. Templates, pictures and style definitions take
care of the design, when PHP does the logic.
So, I distinguished the following path types:
* TEMPLATE-2-TEMPLATE: {include file=dir1/aaa.tpl};
* TEMPLATE-2-STATIC FILE: <img src="dir2/aaa.jpg">;
* TEMPLATE-2-SCRIPT: <a href="dir3/aaa.php">;
Every time I construct a Smarty object, I pass those dirs and use them
later like this: <img src="{$dir2}/aaa.jpg">.
--
Smarty General Mailing List (http://smarty.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php