Friday, January 27, 2012

magento 1.5

Magento 1.5 doesnt allow one to addjs or addskinjs with a custom sorting order...
its because the head.phtml file is doesn't support it in getCssJsHtml() and getIncludes();

One way to solve it is to inject script directly into head.phtml, but put it into your own template folder...
copy from app/design/frontend/base/default/template/page/html/head.phtml to
app/design/frontend/[yourtemplate]/default/template/page/html/

Another thing to take note is getUrl and getSkinURL gotcha...
Example:
$this->getSkinUrl("js/java.js"); // return skin/frontend/[base_or_yourtemplate]/default/js/java.js
but
$this->getUrl("js/java.js"); // return http://yourbasepath.com/js/java.js/


Work around will be using $this->getUrl(""). "js/java.js"

No comments: