Reorder Magento JavaScript Includes (addJs)

前端 未结 7 1579
无人共我
无人共我 2021-02-09 01:37

I\'ll keep this simple.... on my product pages I need to remove the prototype.js file and replace it with the latest version of prototype. So far using local.xml I have successf

7条回答
  •  北恋
    北恋 (楼主)
    2021-02-09 02:21

    I realize this post is pretty old but i stumbled on it while researching this problem, so i figured why not.

    Not sure if this is the most elegant solution, but its working sufficiently well for us.

    I basically created a new block in my local.xml like this:

    Then just modified my main layouts (1column.phtml and friends) to contain this: getBlockHtml('prehead') ?> getChildHtml('head') ?>

    In main.phtml I add my JS that I want to load first

    This is convenient for us as well because it still allows us to change the main.js depending on what page we are on by doing something like this in local.xml:

    Hope it helps someone who happens to stumble on this.

    -Ken

提交回复
热议问题