What I want to achieve: I want a local js file included in the <head>
only when a particular static block type is called.
Example: When "gallery/view" block type is called like so, {{block type="gallery/view" name="catalog.gallery" template="catalog/category/category-gallery.phtml"}}, I want gallery.js to load.
The issue: I believe the layout xml has already been processed before magento renders static blocks. So I don't think I can add to the <head>
from within the Namespace_Gallery_Block_View class.
Obviously I could just add gallery.js via local.xml on every page but the entire point of this is to limit filesize and only call the resources that are absolutely needed per page.
Additionally, I want to use js combination so i have to actually update the layout somehow.
Does anyone have an alternate method or idea to get this working in this manner? I'm not sure if what I want do is actually possible.