cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Alexander Schatten <ala...@gmx.at>
Subject Re: serving css and images
Date Fri, 08 Aug 2003 09:14:04 GMT
Ben Munat wrote:

> Hello. I'm very new to Cocoon... wobbling along. At this point I'm 
> just trying to get Cocoon to serve an xml file transformed to xhtml 
> with an xslt. Well actually, I did get it to serve the file. However, 
> the resulting page has a link to an image and a css file and those are 
> not coming through.
>
> I have the Cocoon Developer's Handbook and it seems to indicate that I 
> need to do this in my subsitemap:
>
>        <map:pipeline>
>            <map:match pattern="**/*.css">
>                <map:read mime-type="text/css" src="style/{2}.css"/>
>            </map:match>
>        </map:pipeline>
>
>        <map:pipeline>
>            <map:match pattern="**/*.gif">
>                <map:read mime-type="text/css" src="style/{2}.css"/>
>            </map:match>
>        </map:pipeline>
>
> However, that hasn't solved the problem. Anyone have any idea what I'm 
> missing? I do need to have these pipelines in my sitemap so that pages 
> can find their images and stylesheets, right?

yes correct, are the path settings correct: the two fragments assume, 
that the CSS stylesheets are in the subdirectory style. so if e.g. the 
CSS link in the generated HTML document is "mystyle.css" then cocoon 
searches for this css in "style/mystyle.css"

moreover this match statememt seems also to remove all path information 
from the request and only select the filename. I have no idea why this 
is recommended in a book, but maybe you should better try something like 
this:

       <map:pipeline>
           <map:match pattern="**.gif">
               <map:read mime-type="text/css" src="images/{1}.gif"/>
           </map:match>
       </map:pipeline>


then: if the request ist for "myphotos/myphoto.gif" then this gif is 
searched at: "images/myphotos/myphoto.gif"


alex


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org


Mime
View raw message