Following the Magento Wiki, there is an excellent article on creating custom CMS pages.
However, twice this week we have heard on stack exchange (and from an intern) that following the article verbatim, their custom module and CMS pages were not appearing. The code looked fine copied and pasted in all cases, but their custom layouts were not appearing.
Here is an example from the wiki:
app/etc/modules/Fruit_Banana.xml
<?xml version="1.0"?> <config> <modules> <Fruit_Banana> <active>true</active> <codePool>local</codePool> <depends> <Mage_Page /> </depends> </Fruit_Banana> </modules> </config>
This code will work great. The issue people were having is that they had space before the XML declaration. The XML declaration MUST be on the first line at the FIRST position. If you are having issues with your CMS page modules, this is likely the cause!
Example of a bad declaration:
<?xml version="1.0"?> <config> <modules> <Fruit_Banana> <active>true</active> <codePool>local</codePool> <depends> <Mage_Page /> </depends> </Fruit_Banana> </modules> </config>
What is causing so many people to have issues with this is the fact that when copying XML from Magento’s Wiki, white space is added in front of every line, so a direct copy and paste will give you XML that cannot be parsed.
One Response to Magento 1.7: Issues Adding Custom CMS Page Templates?