I have a custom extension that includes jQuery through layout XML like so:
<reference name="head">
<action method="addJs"><script>jquery/jquery-1.8.1.min.js</script></action>
</reference>
Other extensions that use jQuery need to be loaded after my module so jQuery remains on top.
By default Magento loads everything alphabetically. Is there any way to specify a sort order for extensions?
One way is to override page.xml
in my theme and manually include jQuery into the head or I can set every custom module to depend on the module I want on top for example:
<depends>
<Package_JQueryLib />
</depends>
Any other recommendations?
Edit
I was thinking I could also override Mage_Page_Block_Html_Head
and modify the addItem()
method to include sorting or prepending files to the head.