Monday, 15 July 2013

Magento Layout xml in custom module not working -


Hello Magento professionals.

I am writing a custom module for magento and here are some problems. My layout xml does not work first - caching is disabled, compilation is disabled, magester developer mode is enabled and logging is enabled . Everything is being configured properly, but I'm not getting an exception or log too.

My module config.xml:

  & lt ;? Xml version = "1.0" & gt; & Lt; Config & gt; & Lt; Module & gt; & Lt; Namespace_Module & gt; & Lt; Version & gt; 1.1.0 & lt; / Edition & gt; & Lt; Depends & gt; & Lt; Mage_Catalog / & gt; & Lt; / Depends & gt; & Lt; / Namespace_Module & gt; & Lt; / Module & gt; & Lt; Global & gt; & Lt; Helpers & gt; & Lt; Module & gt; & Lt; Classes & gt; Namespace_Module_Helper & lt; / Square & gt; & Lt; / Module & gt; & Lt; / Helpers & gt; & Lt; Model & gt; ... & lt; / Model & gt; & Lt; Block & gt; ... & lt; / Block & gt; & Lt; / Global & gt; & Lt; Front & gt; & Lt; Router & gt; & Lt; Module & gt; & Lt; Use & gt; Standard & lt; / Usage & gt; & Lt; Arg & gt; & Lt; Module & gt; Namespace_Module & lt; / Module & gt; & Lt; FrontName & gt; Module & lt; / FrontName & gt; & Lt; / Arg & gt; & Lt; / Module & gt; & Lt; / Router & gt; & Lt; Layout & gt; & Lt; Update & gt; & Lt; Module & gt; & Lt; File & gt; Module / module Xml & lt; / File & gt; & Lt; / Module & gt; & Lt; / Update & gt; & Lt; / Layout & gt; & Lt; / Frontend & gt; & Lt; Admin & gt; & Lt; Router & gt; & Lt; Adminhtml & gt; ... & lt; / Adminhtml & gt; & Lt; / Router & gt; & Lt; / Admin & gt; & Lt; Adminhtml & gt; & Lt; Layout & gt; & Lt; Update & gt; & Lt; Module & gt; & Lt; File & gt; Module.xml & lt; / File & gt; & Lt; / Module & gt; & Lt; / Update & gt; & Lt; / Layout & gt; & Lt; / Adminhtml & gt; & Lt; / Config & gt;   

I simply set "namespaces" and "modules" as placeholders for custom namespace and custom module names.

In the layout xml for the foreground, I just put in a wrong configuration to see if this is an error, but the XML file can not be parsed, for example i & Lt; Layout & gt; & Lt; / Xxxlayout & gt;

What's wrong with the configuration?

The layout xml file is bas / default / layout / module / module.xml

the administrator layout, which I have configured in the same file, works perfectly!

This is the number of things (something that can be used in your config.xml Change before posting here, will not be debuggable with it), but one thing that immediately pops up

  & lt; File & gt; Module / module Xml & lt; / File & gt;   

should be

  & lt; File & gt; Module / module.xml & lt; / File & gt;   

For innumerable and complex reasons, Magento and PHP parse are important in text nodes with white space in XML documents. This means that when the layout update XML parsing code goes here

  #File: app / code / core / mage / core / model / layout / update.php public function getFileLayoutUpdatesXml (// alien Currency ($ updateFiles $ file) {$ filename = $ design-> getLayoutFilename ($ file, array ('_area' = & gt; $ area, '_package ='> $ package, '_theme' = & gt; Subject));; (! Is_readable ($ filename)) {continue;}   

This generates for your code $ filename string <<> P> That is, with the old hunk of white space in between

Remove the white space from your node and you will remove a potential problem.

No comments:

Post a Comment