I successfully added some custom JS and CSS to my head section (look here).
But If I try to add a script at the block before_body_end
then I get:
There has been an error processing your request Invalid method Mage_Core_Block_Text_List::addItem(Array ( [0] => skin_js [1] => black/NewsletterPopup/js/main.js )
app\design\frontend\base\default\layout\black\newsletter_popup.xml
<?xml version="1.0"?>
<layout version="0.1.0">
<default>
<reference name="head">
<action method="addItem">
<type>skin_js</type>
<script>black/NewsletterPopup/js/jquery.magnific-popup.min.js</script>
</action>
<action method="addCss">
<stylesheet>black/NewsletterPopup/css/magnific-popup.css</stylesheet>
</action>
<action method="addCss">
<stylesheet>black/NewsletterPopup/css/main.css</stylesheet>
</action>
</reference>
<reference name="before_body_end">
<action method="addItem">
<type>skin_js</type>
<script>black/NewsletterPopup/js/main.js</script>
</action>
</reference>
</default>
<!-- ... -->
addItem
method not existcore/text_list
you can call your custom modules block there.addItem
is not supported for blocks with typecore/text_list
for whatever reason. I can call my modules block which includes html., But how can I properly include my script?before_body_end
.<script></script>
block to the template with the script.