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:

[% root = '/Users/mysilmaril/Sites/WIW' images = '$root/assets/images" %]
And then in my HTML image tags ... <img src="[% images %]/logo.jpg">

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.


In reply to Re^2: Template Toolkit Question by Perobl
in thread Template Toolkit Question by Perobl

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.