0

I want to add an embedded MailChimp script to my Magento 1 installation. However, the script has an attribute:

<script type="text/javascript" src="//downloads.mailchimp.com/js/signup-forms/popup/embed.js" data-dojo-config="usePlainJson: true, isDebug: false"></script>

(the data-dojo-config attribute)

How can I add this attribute using the addItem method?

2
  • Do you need to do this in xml? You could add it in miscellaneous scripts or miscellaneous html (system>config>general>design)
    – jscar
    Nov 3, 2017 at 15:32
  • @jscar It would make my life alot easier if I could add in the layout :p Then I can just move it to another environment without importing the database Nov 6, 2017 at 9:08

1 Answer 1

0

The best solution I could find was this:

<?xml version="1.0" encoding="utf-8"?>
<layout version="0.1.0">

    <default>
        <reference name="head">

            <!-- Embedded JS for MailChimp Subscribe popup -->

            <block type="core/text" name="mailchimp.popup.embed">
                <action method="setText">
                    <text>
                        <![CDATA[<script type="text/javascript" src="//downloads.mailchimp.com/js/signup-forms/popup/embed.js" data-dojo-config="usePlainJson: true, isDebug: false"></script>]]>
                    </text>
                </action>
            </block>

        </reference>
    </default>
</layout>

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.