in reply to Re^2: Template Toolkit Question
in thread Template Toolkit Question
I think the easiest solution would be to have your designers type src="/images/logo.jpg", href="/css/wiw.css", etc. and then put the respective files in the directories
/Users/mysilmaril/Sites/WIW/images /Users/mysilmaril/Sites/WIW/css
(with /Users/mysilmaril/Sites/WIW/ being the webserver's configured document root)
In this case, no additional mapping of path components like /images —> /assets/images would be required (via TT2 [% images %] or whatever).
If you can't get your designers to type anything other than src="/logo.jpg", you could set up a RewriteRule to prepend /assets/images to any URI-path that ends in .jpg, .png, .gif, etc.
P.S.: if you're going to use
[% root = '/Users/mysilmaril/Sites/WIW' images = '$root/assets/images" %] ... <img src="[% images %]/logo.jpg">
I'm pretty sure you don't want the /Users/mysilmaril/Sites/WIW part in there, as the image would then (most likely) be searched under
/Users/mysilmaril/Sites/WIW/Users/mysilmaril/Sites/WIW/assets/images/
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^4: Template Toolkit Question
by Perobl (Beadle) on May 19, 2010 at 22:50 UTC | |
by almut (Canon) on May 19, 2010 at 23:12 UTC | |
by Perobl (Beadle) on May 19, 2010 at 23:48 UTC |