2

I have tried several ways to serve my static resources from Plone with XDV:

  1. Putting the CSS and images in the Custom folder - files are 404 not found
  2. Serving them from Apache and setting the Absolute URL Prefix in the XDV config - works, but any other relatively URL'd links (e.g. PDF files in my content) get prefixed as well and therefore are 404 not found
  3. Setting browser:resourceDirectory - 404 not found
  4. Setting cmf:registerDirectory - 404 not found

Any suggestions? I've turned the log level to DEBUG but this doesn't give me any clues.

drkvogel
  • 2,061
  • 24
  • 17
  • 1
    Putting files in the portal_skins/custom folder should work just fine--many people do it this way all the time. If you have a "my.css" in the custom folder, it'd just be referenced like www.mysite.com/my.css. – vangheem Sep 28 '11 at 16:49

2 Answers2

3

You just need to put your css/js in the "static" directory and than use relative path in the index.html. Diazo/XDV will automagically remap relative paths.

Or you can also register a resourceDirectory in the usual way and than link files like so "++resource++myresourcedirid/my.css"

See an example here.

Giacomo Spettoli
  • 4,476
  • 1
  • 16
  • 24
1

I managed to use static content served by Apache using mod_rewrite and the following rules in Apache Virtual Host configuration.

RewriteRule ^/css - [L]
RewriteRule ^/img - [L]

I have also used Giacomo method for specific Plone content style with the static directory in my package which is linked in the "index.html" as "++resource++mypackage.theme/plone.css"