Posting in the Magento forums has been disabled pending the implementation of a new and improved forum solution which should better serve the community.

For new questions please post at magento.stackexchange.com, the community-run support site for the Magento community. We will be providing updates on the new forum solution soon. For questions or concerns please email community@magento.com.

Magento Forum

Getting “Please enter valid XML data” when adding multiple references to a categories Custom Layout Update field
 
Shizzler
Jr. Member
 
Total Posts:  9
Joined:  2011-03-02
 

I got two references I would like to add to a categories Custom Layout Update field. When I add them separately it works ok. But when I add them both to the Custom Layout Update field of a Category, I get a “Please enter valid XML data”.

First reference
<reference name="head">
<action method="addItem">
<type>skin_js</type>
<script>js/my_script.js</script>
</action>
</reference>

Second reference
<reference name="left">
<block type="core/template" name="submenu.men" template="submenus/men.phtml" />
</reference>

I want to add the js file in the head, where it should be. but I see no other solution than calling it from the phtml file. Can someone tell me the secret of adding multiple references to a categories Custom Layout Update field?

 
Magento Community Magento Community
Magento Community
Magento Community
 
Ukrainian Wolf
Jr. Member
 
Total Posts:  4
Joined:  2009-09-30
 

Try this code:

<reference name="root">

<reference name="head">
<action method="addItem">
<type>skin_js</type>
<script>js/my_script.js</script>
</action>
</reference>
<reference name="left">
<block type="core/template" name="submenu.men" template="submenus/men.phtml" />
</reference>

</reference>

 
Magento Community Magento Community
Magento Community
Magento Community
 
Shizzler
Jr. Member
 
Total Posts:  9
Joined:  2011-03-02
 

Thx, that did the trick!

 
Magento Community Magento Community
Magento Community
Magento Community
Magento Community
Magento Community
Back to top