I would like to set up a page template to use the stylesheet my.css if it is in the current folder, but if not to use the one in the root folder. How do I specify this? -- John
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 John Poltorak wrote:
I would like to set up a page template to use the stylesheet my.css if it is in the current folder, but if not to use the one in the root folder.
How do I specify this?
Assuming that you mean "containing" folder (rather than root), you can just acquire the object and ask for its absolute_url, e.g:: <link type="text/css" href="my.css" tal:attributes="href string:${context/my.css/absolute_url}" /> If you want the local one, or one in some "root" folder (but not any intervening ones), then you probably need to write a PythonScript which finds the stylesheet file object using whatever logic is appropriate, and return its absolute_url. You would then call that script in TAL:: <link type="text/css" href="my.css" tal:attributes="href string:${context/find_stylesheet_url}" /> Tres. - -- =================================================================== Tres Seaver +1 202-558-7113 tseaver@palladion.com Palladion Software "Excellence by Design" http://palladion.com -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.1 (GNU/Linux) Comment: Using GnuPG with Thunderbird - http://enigmail.mozdev.org iD8DBQFEHtI/+gerLs4ltQ4RAhuiAJ9A7LQmFt+9u2cf6MU7TY5zRlwAHgCgrtow 5d1w6G7vKqrH2hTsqsXdGgU= =pYTJ -----END PGP SIGNATURE-----
On Mon, Mar 20, 2006 at 03:44:02PM +0000, John Poltorak wrote:
I would like to set up a page template to use the stylesheet my.css if it is in the current folder, but if not to use the one in the root folder.
How do I specify this?
This is a very common and basic usage of implicit acquisition. Something like: <link rel="stylesheet" type="text/css" href="" tal:attributes="href context/my.css/absolute_url" /> -- Paul Winkler http://www.slinkp.com
On Mon, Mar 20, 2006 at 11:04:03AM -0500, Paul Winkler wrote:
On Mon, Mar 20, 2006 at 03:44:02PM +0000, John Poltorak wrote:
I would like to set up a page template to use the stylesheet my.css if it is in the current folder, but if not to use the one in the root folder.
How do I specify this?
This is a very common and basic usage of implicit acquisition. Something like:
<link rel="stylesheet" type="text/css" href="" tal:attributes="href context/my.css/absolute_url" />
I did have that although it didn't work properly but I understand why now. If my.css contains background-image: url(images/background.gif); how would 'images/'be resolved? (Assuming I have an 'images folder in the current folder and its parent.)
--
Paul Winkler http://www.slinkp.com
-- John
On Mon, Mar 20, 2006 at 04:22:12PM +0000, John Poltorak wrote:
If my.css contains
background-image: url(images/background.gif);
how would 'images/'be resolved? (Assuming I have an 'images folder in the current folder and its parent.)
This is decided by the client. http://www.htmlhelp.com/reference/css/units.html#urls -- Paul Winkler http://www.slinkp.com
participants (3)
-
John Poltorak -
Paul Winkler -
Tres Seaver