0

In my local.xml I have added a new javascript load command. It is exactly the same as another javascript.

<action method="addItem">
    <type>skin_js</type
    <name>rateyo/jquery.rateyo.min.js</name>
</action>
<action method="addItem">
    <type>skin_js</type>
    <name>jquery.cbpContentSlider.js</name>
</action>

Yet I get a 404 in the browser because the link created for the second is in base, not in my theme.

<script type="text/javascript" src="https://.../skin/frontend/rwd/alpine2/rateyo/jquery.rateyo.min.js"></script>
<script type="text/javascript" src="https://.../skin/frontend/base/default/jquery.cbpContentSlider.js"></script>

WHY????????

I flush every cache, don't have compilation on, dont have merging, this is the dev site so no full page cache installed etc. etc. etc. Even though it sounds absurd I tried putting it in a subfolder, since that is one difference, but it has the same problem.

Why is one generated with correct skin reference and the other one not?

updating with a few more details

calling .../skin/frontend/rwd/alpine2/js/jquery.cbpContentSlider.js in the browser works, which shows that file is in the wrong place. But the URL Magento generates, which has the js removed, does not work.

3
  • first magento search the files from theme folder, if not found then it uses the base folder content Feb 28, 2018 at 6:26
  • Does your current theme have base as a parent? Feb 28, 2018 at 8:30
  • rwd is the parent, which then has base as a parent. but the file is in the correct location - "https://.../skin/frontend/base/default/js/jquery.cbpContentSlider.js" exactly like there is a "https://.../skin/frontend/rwd/alpine2/js/rateyo/jquery.rateyo.min.js" But for one it generates the correct skin link, and the other one not, it reverts to base. Can it not see it?
    – iphigenie
    Feb 28, 2018 at 18:07

1 Answer 1

1

When Magento looks in the base theme, this is generally because the file does not exist in your theme.

You should double check if the jquery.cbpContentSlider.js file is in skin/frontend/rwd/alpine2/ folder .

4
  • it has to be it - although the file is uploaded to the right place, something has to be preventing the php code from seeing it. Permissions seem right, so I will need to figure out if there's stupid rewrites or security settings somewhere on the host that block it.
    – iphigenie
    Feb 27, 2018 at 19:05
  • the files are both under skin/frontend/rwd/alpine2/js/ - and for one the link put in the html (without /js/) skin/frontend/rwd/alpine2/ works and for the other one it doesn't. Puzzling
    – iphigenie
    Feb 28, 2018 at 18:11
  • If your files are in skin/frontend/rwd/alpine2/js/, you should write : <action method="addItem"> <type>skin_js</type <name>js/rateyo/jquery.rateyo.min.js</name> </action> <action method="addItem"> <type>skin_js</type> <name>js/jquery.cbpContentSlider.js</name> </action> Feb 28, 2018 at 19:24
  • yikes. i thought because the other one worked that the js was more of magento's mystery autorewrites. The mystery now is not why one doesn't work, it's why the other does work. That is someone else's mess... I should have gotten the hint the first time i noticed the missing js, rather than imagine "magic"
    – iphigenie
    Mar 1, 2018 at 0:36

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.