Plone 5.2 - Why isn't my javascript file showing up in the registry?

I'm trying to get a javascript file registered, but I can't figure out what I am doing wrong.

In my.product/src/my/product, I add a directory called 'static'.

In configure.zcml, I add:


Then in the static directory, I add a js file with a simple on click statement:


Then under profiles/default, in registry.xml, I have:

<?xml version="1.0"?>
    <records prefix="plone.resources/my.product.resources"
	<value key="js">++plone++static/myproduct.js</value>

I run quick install and it "registers" because I go to Site Setup -> Resource Registries, I see 'my.product.resources' under resources. However, when I go to overrides to check my javascript file's code (Overrides -> ++plone++static/myproduct.js), I get an error popup "error loading resource for editing".

I'm assuming I'm having difficulty pointing to the file in my package, what am I doing wrong?

I might be wrong, but I think you need

<value key="js">++plone++my.product.resources/myproduct.js</value>

Because you registered your own plone static directory under the name 'my.product.resources'

give it a try.


Thank you very much. I was getting confused on the js value. It works now.

Also, I was having an issue where I was getting confused why it wasn't loading unless I linked it in templates I was using. I needed to define a bundle instead.

<records prefix="plone.bundles/my.product.resources"
	<value key="resources">
	<value key="jscompilation">++plone++my.product.resources/mytype.js</value>
1 Like

Plone Foundation Code of Conduct