1

I am using a variation of the 1.9 RWD theme and I want to move the language selector from the header to the footer. This I can do in local.xml, however, after doing so, the block fails to render on the front end for some reason.

In my local.xml I can remove the store_language reference for the header:

    <reference name="header">
        <remove name="store_language"/>

        ...

For the footer I then add in:

    <reference name="footer">
        <block type="page/switch" name="store_language_footer" as="store_language_footer" template="page/switch/languages.phtml"/>

        ...

This seems to show on the frontend but not actually rendering the block.

With template path hints turned on, on the header before adding the 'remove' line I get this:

Header-RWD

Behind the red bits is the drop-down I want to appear in the footer.

However, in the footer, I get this:

Footer RWD

I see that the block is being called but it is not being rendered.

  • Things I have tried: clearing all cache, sessions and reloading again
  • using 'store_language' instead of 'store_language_footer' in my footer block.
  • Checking exception/system log for anything helpful

There is nothing I can do to explicitly force the block to be rendered in the template as it is already being 'rendered'.

Does anyone have any idea what is wrong?

2

You should not remove it, instead unset the child and then set the child in footer, as you said you need to have a local.xml in the package you have your phtml file, in your case in base package and in its layout folder, you need to have your local.xml,you could also do in default so as to not change base at all.however local.xml itself is a SEPARATE customization so it depends on you.

I guess when you remove it,it is entirely removed from your template after all layout handles were merged, therefore even when you said that block is in footer, it is already been removed and not able to show it.

When you want to just move the phtml file from one reference to another in a page, it is better to unset and set the child.

this works for you:

<?xml version="1.0" encoding="UTF-8"?>
<layout>
    <default>
        <reference name="header">
            <action method="unsetChild">
                <name>store_language</name>
            </action>
        </reference>
        <reference name="footer">
            <action method="insert">
                <blockName>store_language</blockName>
            </action> 
        </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.