From: Mark G. <ma...@gi...> - 2008-10-23 17:55:37
|
You seem to be confusing skins directories with resource directories. You probably don't want a directory to be both a skin directory and a resource directory. However, to get your current setup to work, you would add to your configure.zcml: <browser:resourceDirectory name="Products.RnDTheme.scripts" directory="skins/Products_RnDTheme_scripts" layer=".interfaces.IThemeSpecific" /> This would allow you to add the javascript to the registry using the '++resoucre++' because you are regitering the skins/Products_RnD... as a resource diretory. OR Just change your javascript registry to: <javascript id="jquery.corner.js" cacheable="False" compression="safe" cookable="False" enabled="True" expression="" inline="False"/> This will work because the js file will be found through acquisition since it is in a skins directory. Mark jon wrote: >Indeed! My apologies for the lazy question. Here are the facts: > >1. I'm using Plone 3.1.1 running in debug mode. > >2. I created my theme using the paster template. > >3. I wanted to add a directory to store my Javascript files in, so I >did the following: > > a. At the root of my theme in the skins.zcml file I added this >snippet: > > <cmf:registerDirectory > name="Products_RnDTheme_scripts"/> > > b. In the skins/ dir I created the "Products_RnDTheme_scripts" dir >and added my Javascript file: jquery.corner.js. > > c. In the profiles/default/ dir I added this snippet of code to the >jsregistry.xml: > > <javascript id="++resource++Products.RnDTheme.scripts/ >jquery.corner.js" > cacheable="False" compression="safe" cookable="False" > enabled="True" expression="" inline="False"/> > > d. In the profiles/default/ dir I added these to snippets to >skins.xml: > > <object name="Products_RnDTheme_scripts" > meta_type="Filesystem Directory View" > directory="Products.RnDTheme:skins/Products_RnDTheme_scripts"/ > > > > <layer name="Products_RnDTheme_scripts" > insert-after="Products_RnDTheme_styles"/> > > e. I then went to portal_setup in the ZMI and reimported everything >for my theme. > > f. Just because, I restarted Zope as well. > >When I went to my page and viewed the source I could see the file >listed in the HTML but when I tried to access it I got a Javascript >error. > >When I go to portal_javascripts in the ZMI the file is the last one >listed and it's highlighted with the orange/yellow color with >"(resource not found or not accessible)" next to it. > >For now, my workaround is to upload the file directly to Plone and >access it that way. However, this theme is pretty much "by the book", >with that book being Martin Aspelli's book. I'm trying to keep it that >way and would love to figure out what I've done wrong. > >I'm not sure what more information is needed from me but I'd be glad >to provide it. > >Thanks in advance, > >Jon > >On Oct 22, 11:02 pm, Andreas Jung <li...@zopyx.com> wrote: > > >>On 23.10.2008 2:02 Uhr, jon wrote: >> >> >> >>>Howdy....I'm working on a great new Plone 3 theme and I went to add a >>>Javascript to it and when I reimport everything the ZMI tells me that >>>the "resource not found or not accessible". I can view source on the >>>page and see the .js file there but when I go to call a function it >>>throws an error. >>> >>> >>>What, if anything, am I doing wrong? >>> >>> >>Given the poor facts there is little we can do - except guessing. I >>recommend that you create your theme using paster+Zopeskel. The >>generated skeleton are supposed to work properly. If you have your own >>implementation then you must provide more reasonable information. >> >>http://www.catb.org/~esr/faqs/smart-questions.html >> >>Andreas >> >> lists.vcf >>< 1KViewDownload >> >>------------------------------------------------------------------------- >>This SF.Net email is sponsored by the Moblin Your Move Developer's challenge >>Build the coolest Linux based applications with Moblin SDK & win great prizes >>Grand prize is a trip for two to an Open Source event anywhere in the worldhttp://moblin-contest.org/redirect.php?banner_id=100&url=/ >> >>_______________________________________________ >>Plone-Users mailing list >>Plone-Us...@lists.sourceforge.nethttps://lists.sourceforge.net/lists/listinfo/plone-users >> >> > >------------------------------------------------------------------------- >This SF.Net email is sponsored by the Moblin Your Move Developer's challenge >Build the coolest Linux based applications with Moblin SDK & win great prizes >Grand prize is a trip for two to an Open Source event anywhere in the world >http://moblin-contest.org/redirect.php?banner_id=100&url=/ >_______________________________________________ >Plone-Users mailing list >Plo...@li... >https://lists.sourceforge.net/lists/listinfo/plone-users > > > |