さまざまなチュートリアルを試しましたが、これを機能させることができません。
基本的に、ホームページに別のフッターを付けたいと思っています。2 つのページ レイアウトを設定し、cms ページに適用しました。
だから私が参照するホームページのレイアウトで...
<?php echo $this->getChildHtml('footer_home') ?>
そして、他のすべてのページでは、これ...
<?php echo $this->getChildHtml('footer_alt') ?>
ものすごく単純!次に、ページxmlで、フッターを参照する部分を次のように修正しました...
<block type="page/html_footer" name="footer_alt" as="footer_alt" template="page/html/footer_alt.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>
<block type="page/switch" name="store_switcher" as="store_switcher" template="page/switch/stores.phtml"/>
<block type="page/template_links" name="footer_links" as="footer_links" template="page/template/links.phtml"/>
</block>
<block type="page/html_footer" name="footer_home" as="footer_home" template="page/html/footer_home.phtml">
<block type="page/html_wrapper" name="bottom.container" as="bottomContainer" translate="label">
<label>Page Footer2</label>
<action method="setElementClass"><value>bottom-container</value></action>
</block>
<block type="page/switch" name="store_switcher" as="store_switcher" template="page/switch/stores.phtml"/>
<block type="page/template_links" name="footer_links" as="footer_links" template="page/template/links.phtml"/>
</block>
ここに問題があると思います。上記のすべてのページで「footer_alt」フッターが表示されますが、その理由はわかりません。
「page/html/footer_alt.phtml」と「page/html/footer_home.phtml」が正しく設定されていることを確認できます。
それが理にかなっていることを願っています。ありがとう。