<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-2">
<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40">

<head>

<meta name=Generator content="Microsoft Word 12 (filtered medium)">
<style>
<!--
 /* Font Definitions */
 @font-face
        {font-family:Wingdings;
        panose-1:5 0 0 0 0 0 0 0 0 0;}
@font-face
        {font-family:"Cambria Math";
        panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
        {font-family:Calibri;
        panose-1:2 15 5 2 2 2 4 3 2 4;}
@font-face
        {font-family:Tahoma;
        panose-1:2 11 6 4 3 5 4 4 2 4;}
 /* Style Definitions */
 p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0cm;
        margin-bottom:.0001pt;
        font-size:12.0pt;
        font-family:"Times New Roman","serif";}
a:link, span.MsoHyperlink
        {mso-style-priority:99;
        color:blue;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {mso-style-priority:99;
        color:purple;
        text-decoration:underline;}
p.MsoListParagraph, li.MsoListParagraph, div.MsoListParagraph
        {mso-style-priority:34;
        margin-top:0cm;
        margin-right:0cm;
        margin-bottom:0cm;
        margin-left:36.0pt;
        margin-bottom:.0001pt;
        font-size:12.0pt;
        font-family:"Times New Roman","serif";}
span.Stylwiadomocie-mail17
        {mso-style-type:personal-reply;
        font-family:"Calibri","sans-serif";
        color:#1F497D;}
.MsoChpDefault
        {mso-style-type:export-only;}
@page Section1
        {size:612.0pt 792.0pt;
        margin:70.85pt 70.85pt 70.85pt 70.85pt;}
div.Section1
        {page:Section1;}
 /* List Definitions */
 @list l0
        {mso-list-id:387336674;
        mso-list-type:hybrid;
        mso-list-template-ids:-731219868 -1523001892 68485123 68485125 68485121 68485123 68485125 68485121 68485123 68485125;}
@list l0:level1
        {mso-level-start-at:0;
        mso-level-number-format:bullet;
        mso-level-text:\F06E;
        mso-level-tab-stop:none;
        mso-level-number-position:left;
        text-indent:-18.0pt;
        font-family:Wingdings;
        mso-fareast-font-family:Calibri;
        mso-bidi-font-family:"Times New Roman";}
@list l1
        {mso-list-id:790516074;
        mso-list-type:hybrid;
        mso-list-template-ids:-935584652 586446098 68485123 68485125 68485121 68485123 68485125 68485121 68485123 68485125;}
@list l1:level1
        {mso-level-start-at:0;
        mso-level-number-format:bullet;
        mso-level-text:\F06E;
        mso-level-tab-stop:none;
        mso-level-number-position:left;
        text-indent:-18.0pt;
        font-family:Wingdings;
        mso-fareast-font-family:Calibri;
        mso-bidi-font-family:"Times New Roman";}
ol
        {margin-bottom:0cm;}
ul
        {margin-bottom:0cm;}
-->
</style>
<!--[if gte mso 9]><xml>
 <o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
 <o:shapelayout v:ext="edit">
  <o:idmap v:ext="edit" data="1" />
 </o:shapelayout></xml><![endif]-->
</head>

<body lang=PL link=blue vlink=purple>

<div class=Section1>

<p class=MsoNormal><span lang=EN-US style='font-size:11.0pt;font-family:"Calibri","sans-serif";
color:#1F497D'>Just add &#8216;img&#8217; directory to rend.Page.children:<o:p></o:p></span></p>

<p class=MsoNormal><span lang=EN-US style='font-size:11.0pt;font-family:"Calibri","sans-serif";
color:#1F497D'><o:p>&nbsp;</o:p></span></p>

<p class=MsoNormal><span lang=EN-US style='font-size:11.0pt;font-family:"Calibri","sans-serif";
color:#1F497D'>                children = { &#8216;defaults.css&#8217; : static.File(&#8230;),<o:p></o:p></span></p>

<p class=MsoNormal><span lang=EN-US style='font-size:11.0pt;font-family:"Calibri","sans-serif";
color:#1F497D'>                                               &#8216;img&#8217;:
static.File(&#8216;path_to_image_directory&#8217;)}<o:p></o:p></span></p>

<p class=MsoNormal><span lang=EN-US style='font-size:11.0pt;font-family:"Calibri","sans-serif";
color:#1F497D'><o:p>&nbsp;</o:p></span></p>

<p class=MsoNormal><span lang=EN-US style='font-size:11.0pt;font-family:"Calibri","sans-serif";
color:#1F497D'>HTH,<o:p></o:p></span></p>

<p class=MsoNormal><span lang=EN-US style='font-size:11.0pt;font-family:"Calibri","sans-serif";
color:#1F497D'>-- <o:p></o:p></span></p>

<p class=MsoNormal><span lang=EN-US style='font-size:11.0pt;font-family:"Calibri","sans-serif";
color:#1F497D'>m<o:p></o:p></span></p>

<p class=MsoNormal><span lang=EN-US style='font-size:11.0pt;font-family:"Calibri","sans-serif";
color:#1F497D'><o:p>&nbsp;</o:p></span></p>

<div style='border:none;border-top:solid #B5C4DF 1.0pt;padding:3.0pt 0cm 0cm 0cm'>

<p class=MsoNormal><b><span style='font-size:10.0pt;font-family:"Tahoma","sans-serif"'>From:</span></b><span
style='font-size:10.0pt;font-family:"Tahoma","sans-serif"'>
twisted-web-bounces@twistedmatrix.com
[mailto:twisted-web-bounces@twistedmatrix.com] <b>On Behalf Of </b>Eric Medina<br>
<b>Sent:</b> Wednesday, October 28, 2009 8:46 AM<br>
<b>To:</b> twisted-web@twistedmatrix.com<br>
<b>Subject:</b> [Twisted-web] using css with nevow<o:p></o:p></span></p>

</div>

<p class=MsoNormal><o:p>&nbsp;</o:p></p>

<p class=MsoNormal>Hi,<br>
<br>
I have been using twisted quite a bit these last 6 months for a networked
application i'm<br>
working on. Recently, i've decided to port the web part of the app from spyce
to nevow.<br>
However, i have encountered a problem with using css file. My css file has
references to<br>
image files like below:<br>
<br>
<i>...<br>
body {<br>
&nbsp;&nbsp;&nbsp; background: #EEE url(img/bg.gif);<br>
&nbsp;&nbsp;&nbsp; color: #444;<br>
&nbsp;&nbsp;&nbsp; font: normal 62.5% &quot;Lucida Sans
Unicode&quot;,sans-serif;<br>
&nbsp;&nbsp;&nbsp; margin: 0;<br>
}<br>
...</i><br>
<br>
The following is a test file that loads an external xml file which references a
css file:<br>
<br>
<i>class TestPage(rend.Page):<br>
&nbsp;&nbsp;&nbsp; addSlash = True<br>
&nbsp;&nbsp;&nbsp; child_images = static.File('img')<br>
&nbsp;&nbsp;&nbsp; children = {'default.css': static.File('default.css')}<br>
&nbsp;&nbsp;&nbsp; docFactory = loaders.xmlfile('webtest.html')<br>
<br>
site = appserver.NevowSite(TestPage())<br>
reactor.listenTCP(8080, site)<br>
reactor.run()</i><br>
<br>
The problem is that the images referenced inside the css file is not being
loaded when<br>
the page is rendered. Can someone tell me how to fix this? This is the first
time i've used <br>
nevow or even twisted.web.<br>
<br>
Thank you very much.<br>
<br>
Regards,<br>
<span style='color:#888888'>Eric </span><o:p></o:p></p>

</div>

</body>

</html>