in reply to Re: Template Toolkit Question
in thread Template Toolkit Question
I think absolute URLs are turned off by default in TT2. Isn't there a reason for this?
Allow me to provide some additional information. I chose to use TT2 because I want to separate the code from the HTML as much as possible. Ideally, I'd like to give our web designers creative control of the HTML (they are not coders).
They will be creating the HTML using Coda (an editor). All of the image links in the HTML are relative to the site's root directory (and this is fine by me). I would simply like to grab their HTML code and drop it into my TT2 wrapper whenever they make changes. I will then send my CGI generated output to the page using the [% content %] directive. Very clean solution for us.
The only problem is, I haven't figured out a way to make the image links work (or the external CSS for that matter).
I think I can use a TT2 config template, such as:
And then in my HTML image tags ... <img src="[% images %]/logo.jpg">[% root = '/Users/mysilmaril/Sites/WIW' images = '$root/assets/images" %]
However, this would still require us to hardcode the [% images %] TT2 variable into the HTML. I was hoping to avoid this, but maybe it isn't possible?
Hope I'm not confusing everyone ...
Thanks.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^3: Template Toolkit Question
by almut (Canon) on May 19, 2010 at 22:20 UTC | |
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 |