5

I am having trouble getting a custom .phtml file to output in the footer.

Here is the path to the file:

beckin/themesettings/socialaccounts.phtml

I created an xml file called beckin_themesettings.xml

Here is what I have inside of the xml file:

<?xml version="1.0"?>

<layout version="0.1.0">


           <reference name="footer">
                 <block type="core/template" name="socialAccounts" template="beckin/themesettings/socialaccounts.phtml"/>
           </reference>


</layout>

Here is how I am calling it in my footer: <?php echo $this->getChildHtml('socialAccounts') ?>

But it is not rendering the file.

However, if I move the info to the page.xml file it will work. What am I doing wrong?

Here is the relevant part of the page.xml file:

        <block type="page/html_footer" name="footer" as="footer" template="page/html/footer.phtml">
            <block type="page/html_wrapper" name="bottom.container" as="bottomContainer" translate="label">
                <label>Page Footer</label>
                <action method="setElementClass"><value>bottom-container</value></action>
            </block>
/*** If I enter my block here it will work??? ***/
            <block type="page/template_links" name="footer_links" as="footer_links" template="page/template/links.phtml"/>
            <block type="page/switch" name="store_switcher" as="store_switcher" template="page/switch/stores.phtml"/>
            <block type="beckintwitter/twitter" name="twitter_feeds" as="twitter_feeds" template="twitter/twitter.phtml"/>
        </block>

Here is my config.xml file

<?xml version="1.0"?>
<config>
    <modules>
        <Beckin_ThemeSettings>
            <version>1.0.0</version>
        </Beckin_ThemeSettings>
    </modules>
    <frontend>
        <layout>
            <updates>
                <themesettings>
                    <file>beckin_themesettings.xml</file>
                </themesettings>
            </updates>
        </layout>
    </frontend>
    <global>
        <helpers>
            <themesettings>
                <class>Beckin_ThemeSettings_Helper</class>
            </themesettings>
        </helpers>
    </global>
    <default>

    </default>
</config>

1 Answer 1

7

Replace it with the following and it should work. You don't need to create another block, just reference it.

<default>
<reference name="footer">
<block type="core/template" name="socialAccounts" template="beckin/themesettings/socialaccounts.phtml"/>
</reference>
</default>
13
  • Thanks for your post. Just tried that again but that didn't work :(
    – user693
    Commented Mar 16, 2013 at 16:08
  • Did you correctly add the layout file in your config.xml? Commented Mar 16, 2013 at 16:11
  • Everything looks good from what I can tell. I posted it above :)
    – user693
    Commented Mar 16, 2013 at 16:20
  • i'm not sure but you might need to loose the underscore in the layout files name. I'm not 100% sure but Magento might convert that to a directory slash. Commented Mar 16, 2013 at 16:22
  • It doesn't.. The underscore is fine. I have two other xml files that use the underscore. Just to double check I removed that in both files and still nothing..
    – user693
    Commented Mar 16, 2013 at 16:25

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.