Anthony
Anthony

Reputation: 3218

Magento: local.xml doesn't show block

So I have empty package where is stored local.xml

(Paths I don't describe here, all caches disabled, error logs turned on).

I've added static block in admin panel. It is named "two_level_links".

Then I added code to local.xml:

<?xml version="1.0"?>

<layout version="0.1.0">
    <default>
        <reference name="header">
            <remove name="top.links"/>
            <block type="cms/block" name="topTwoLevelLinks">
                <action method="setBlockId">
                    <block_id>two_level_links</block_id>
                </action>
           </block>
        </reference>
    </default>
</layout>

In the header phtml file call it:

<?php echo $this->getChildHtml('topTwoLevelLinks') ?>

top.links disappeared but topTwoLevelLinks didn't appear.

Then I looked at Mage_Core_Model_Layout_Update and set a var_dump for getFileLayoutUpdatesXml [$layoutXml]. The source has my block.

Cannot understand what I should do next. How to debug it? Or where I'm doing wrong?

Upvotes: 0

Views: 691

Answers (1)

ceckoslab
ceckoslab

Reputation: 1189

everything looks fine, but let me suggest you to check next things:

  1. Check in admin panel if your block is enabled.
  2. If you have more than one store view, please check if you your block is associated to your current store view, that you see on the frontend
  3. Check in which folder header.phtml file is placed. For example if you changed the header.phtml from your base theme folder "app/design/frontend/base/default", Magento never will know about it if you also have header.phtml in "app/design/frontend/custom_package/custom_theme/" ... if it is not clear enough, please read: http://www.magentocommerce.com/knowledge-base/entry/magentos-theme-hierarchy

Upvotes: 1

Related Questions