0
A
回答
1
我不確定你爲什麼想要這樣做,也許重新組織你的頁面結構將是一個更好的選擇 - 頁腳是頁腳而不是主要內容的一部分。
儘管如此,這可以很容易地使用layout xml來實現。
編輯
有兩種方法可以採用:
1.使用您的基地佈局將覆蓋本地XML文件。 - app/design/frontend/your_package/your_theme/layout/local.xml
這應該是你的首選方法,除非有針對你的特定用例的良好論點。
<?xml version="1.0"?>
<layout>
<default>
<reference name="root">
<action method="unsetChild">
<alias>footer</alias>
</action>
</reference>
<reference name="content">
<action method="insert">
<alias>footer</alias>
</action>
</reference>
</default>
</layout>
或者......
2.複製基本佈局文件
副本app/design/frontend/base/default/layout/page.xml
到app/design/frontend/your_package/yout_theme/layout/page.xml
查找其聲明如下(在非觸摸頁面頁腳節點。 xml CE 1.7):
<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>
<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="core/text_list" name="content" as="content" translate="label">
<label>Main Content Area</label>
<block type="page/html_footer" name="footer" as="footer" template="page/html/footer.phtml" after=">
<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>
記得刷新緩存如果啓用了:)
編輯
要回答的問題關於使用第二種方法的塊定位的評論。您可以使用前後屬性。
即
<block type="page/html_footer" name="footer" as="footer" template="page/html/footer.phtml" after="your_sibling_block_name">
還取決於其他佈局文件,你可能還需要編輯同級塊屬性之前添加到它即before="footer"
相關問題
- 1. 如何在ClearCase中移動觸發器腳本的位置?
- 2. Magento從頁眉移動js腳本
- 3. 固定位置頁腳,隨着頁面滾動而移動
- 4. 如何在vim腳本中移動緩衝區位置
- 5. 如何修復移動設備上的頁眉和頁腳位置?
- 6. Magento 2 - 移動菜單位置
- 7. Phonegap JQM固定位置頁眉/頁腳移動iOS鍵盤後移動
- 8. 將magento頁面標題移動到新位置
- 9. 如何在詩詞(XWPF)中設置頁眉和頁腳位置?
- 10. 如何在頁腳中設置Migradoc文本框的位置?
- 11. 頁腳位置
- 12. 如何設置頁腳在移動網站
- 13. 如何在頁面佈局中移動頁腳
- 14. 在UITableView中放錯位置的頁腳
- 15. 在Magento中的Javascript位置
- 16. 如何在腳本中設置動畫的gameobject位置
- 17. 如何在移動動作中更改CCSprite的位置
- 18. 在頁面底部的位置頁腳
- 19. 動態頁腳鏈接Magento
- 20. SSRS - 頁腳頁腳移動的項目
- 21. 位置在Magento
- 22. 如何讓magento頁腳粘在底部?
- 23. HTML:如何移動對象的位置?
- 24. 的jquery如何偏移滾動位置
- 25. 如何移動圖片的位置?
- 26. MigraDoc頁腳位置
- 27. joomla頁腳位置
- 28. Jquerymobile頁腳移動
- 29. 在乳膠頁面的任意位置移動頁碼
- 30. 如何在Android中選擇可移動SD卡中的位置?
是我已經做this.there有silder和產品部分主頁。因此頁腳部分顯示在它們之間。這意味着在滑塊後顯示頁腳部分,然後顯示產品部分。 – Kichu 2012-07-19 07:46:07
好的,那麼您試圖讓頁腳出現在哪個塊名稱以及您使用了上述兩種方法中的哪一種? – 2012-07-19 07:49:51
我使用的第二種方法 – Kichu 2012-07-19 08:16:51