Beefy Boxes and Bandwidth Generously Provided by pair Networks
go ahead... be a heretic
 
PerlMonks  

comment on

( [id://3333]=superdoc: print w/replies, xml ) Need Help??

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/

In reply to Re^3: Template Toolkit Question by almut
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":



  • Are you posting in the right place? Check out Where do I post X? to know for sure.
  • Posts may use any of the Perl Monks Approved HTML tags. Currently these include the following:
    <code> <a> <b> <big> <blockquote> <br /> <dd> <dl> <dt> <em> <font> <h1> <h2> <h3> <h4> <h5> <h6> <hr /> <i> <li> <nbsp> <ol> <p> <small> <strike> <strong> <sub> <sup> <table> <td> <th> <tr> <tt> <u> <ul>
  • Snippets of code should be wrapped in <code> tags not <pre> tags. In fact, <pre> tags should generally be avoided. If they must be used, extreme care should be taken to ensure that their contents do not have long lines (<70 chars), in order to prevent horizontal scrolling (and possible janitor intervention).
  • Want more info? How to link or How to display code and escape characters are good places to start.
Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others meditating upon the Monastery: (5)
As of 2024-04-24 07:28 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found