Magento - 稍微改变代码后的页面错误

时间:2014-03-13 16:25:48

标签: magento

所以我正在为magento编辑一个页面,只是添加了一个产品品牌滑块,但遗憾的是它以某种方式崩溃了页面。我重新编制了所有内容并刷新了缓存无济于事。所以我只是恢复了旧代码,刷新了,但页面仍然被破坏了。它给我的错误报告是;

a:5:{i:0;s:127:"Invalid method Mage_Page_Block_Html_Topmenu::renderCategoriesMenuHtml(Array
(
[0] => 
[1] => 0
[2] => level-top
)
)";i:1;s:4574:"#0 /home4/johnsoja/public_html/magento1/app/design/frontend/ultimo/default/template/page/html/topmenu.phtml(43): Varien_Object->__call('renderCategorie...', Array)
#1 /home4/johnsoja/public_html/magento1/app/design/frontend/ultimo/default/template/page/html/topmenu.phtml(43): Mage_Page_Block_Html_Topmenu->renderCategoriesMenuHtml(false, 0, 'level-top')
#2 /home4/johnsoja/public_html/magento1/app/code/core/Mage/Core/Block/Template.php(241): include('/home4/johnsoja...')
#3 /home4/johnsoja/public_html/magento1/app/code/core/Mage/Core/Block/Template.php(272): Mage_Core_Block_Template->fetchView('frontend/ultimo...')
#4 /home4/johnsoja/public_html/magento1/app/code/core/Mage/Core/Block/Template.php(286): Mage_Core_Block_Template->renderView()
#5 /home4/johnsoja/public_html/magento1/app/code/core/Mage/Core/Block/Abstract.php(919): Mage_Core_Block_Template->_toHtml()
#6 /home4/johnsoja/public_html/magento1/app/code/core/Mage/Core/Block/Text/List.php(43): Mage_Core_Block_Abstract->toHtml()
#7 /home4/johnsoja/public_html/magento1/app/code/core/Mage/Core/Block/Abstract.php(919): Mage_Core_Block_Text_List->_toHtml()
#8 /home4/johnsoja/public_html/magento1/app/code/core/Mage/Core/Block/Abstract.php(637): Mage_Core_Block_Abstract->toHtml()
#9 /home4/johnsoja/public_html/magento1/app/code/core/Mage/Core/Block/Abstract.php(581): Mage_Core_Block_Abstract->_getChildHtml('topMenu', true)
#10 /home4/johnsoja/public_html/magento1/app/design/frontend/ultimo/default/template/page/html/header.phtml(108): Mage_Core_Block_Abstract->getChildHtml('topMenu')
#11 /home4/johnsoja/public_html/magento1/app/code/core/Mage/Core/Block/Template.php(241): include('/home4/johnsoja...')
#12 /home4/johnsoja/public_html/magento1/app/code/core/Mage/Core/Block/Template.php(272): Mage_Core_Block_Template->fetchView('frontend/ultimo...')
#13 /home4/johnsoja/public_html/magento1/app/code/core/Mage/Core/Block/Template.php(286): Mage_Core_Block_Template->renderView()
#14 /home4/johnsoja/public_html/magento1/app/code/core/Mage/Core/Block/Abstract.php(919): Mage_Core_Block_Template->_toHtml()
#15 /home4/johnsoja/public_html/magento1/app/code/core/Mage/Core/Block/Abstract.php(637): Mage_Core_Block_Abstract->toHtml()
#16 /home4/johnsoja/public_html/magento1/app/code/core/Mage/Core/Block/Abstract.php(581): Mage_Core_Block_Abstract->_getChildHtml('header', true)
#17 /home4/johnsoja/public_html/magento1/app/design/frontend/ultimo/default/template/page/1column.phtml(42): Mage_Core_Block_Abstract->getChildHtml('header')
#18 /home4/johnsoja/public_html/magento1/app/code/core/Mage/Core/Block/Template.php(241): include('/home4/johnsoja...')
#19 /home4/johnsoja/public_html/magento1/app/code/core/Mage/Core/Block/Template.php(272): Mage_Core_Block_Template->fetchView('frontend/ultimo...')
#20 /home4/johnsoja/public_html/magento1/app/code/core/Mage/Core/Block/Template.php(286): Mage_Core_Block_Template->renderView()
#21 /home4/johnsoja/public_html/magento1/app/code/core/Mage/Core/Block/Abstract.php(919): Mage_Core_Block_Template->_toHtml()
#22 /home4/johnsoja/public_html/magento1/app/code/core/Mage/Core/Model/Layout.php(555): Mage_Core_Block_Abstract->toHtml()
#23 /home4/johnsoja/public_html/magento1/app/code/core/Mage/Core/Controller/Varien/Action.php(390): Mage_Core_Model_Layout->getOutput()
#24 /home4/johnsoja/public_html/magento1/app/code/core/Mage/Cms/Helper/Page.php(137): Mage_Core_Controller_Varien_Action->renderLayout()
#25 /home4/johnsoja/public_html/magento1/app/code/core/Mage/Cms/Helper/Page.php(52): Mage_Cms_Helper_Page->_renderPage(Object(Mage_Cms_IndexController), 'home')
#26 /home4/johnsoja/public_html/magento1/app/code/core/Mage/Cms/controllers/IndexController.php(45): Mage_Cms_Helper_Page->renderPage(Object(Mage_Cms_IndexController), 'home')
#27 /home4/johnsoja/public_html/magento1/app/code/core/Mage/Core/Controller/Varien/Action.php(418): Mage_Cms_IndexController->indexAction()
#28 /home4/johnsoja/public_html/magento1/app/code/core/Mage/Core/Controller/Varien/Router/Standard.php(250): Mage_Core_Controller_Varien_Action->dispatch('index')
#29 /home4/johnsoja/public_html/magento1/app/code/core/Mage/Core/Controller/Varien/Front.php(172): Mage_Core_Controller_Varien_Router_Standard->match(Object(Mage_Core_Controller_Request_Http))
#30 /home4/johnsoja/public_html/magento1/app/code/core/Mage/Core/Model/App.php(354): Mage_Core_Controller_Varien_Front->dispatch()
#31 /home4/johnsoja/public_html/magento1/app/Mage.php(684): Mage_Core_Model_App->run(Array)
#32 /home4/johnsoja/public_html/magento1/index.php(87): Mage::run('', 'store')
#33 {main}";s:3:"url";s:10:"/magento1/";s:11:"script_name";s:19:"/magento1/index.php";s:4:"skin";s:7:"default";}

我对Magento来说还是一个新手,所以这一切并没有告诉我多少。我也想剥离代码后崩溃和重建索引应该工作,因为我真的没有添加太多,但我可能完全错误的一切如何工作。谁能指点我的方向?!谢谢!

1 个答案:

答案 0 :(得分:1)

所以看起来第43行的文件app/design/frontend/ultimo/default/template/page/html/topmenu.phtml正在调用

$this->renderCategoriesMenuHtml();

但实际上,函数renderCategoriesMenuHtml()位于类Mage_Catalog_Block_Navigation中(而topMenu.phtml正在类Mage_Page_Block_Html_Topmenu中运行)

我怀疑根本原因是XML文件存在问题,例如app/design/frontend/ultimo/default/layout/local.xml搜索名为“topMenu”的块并查看其type="page/html_topmenu"

现在对我来说有点棘手。假设文件type="ultimo_page/html_topmenu"存在,块类型应该是主题特定的块,如app/code/local/ultimo/page/block/tml/topMenu.php,否则此'topMenu'块需要包含type="catalog/navigation"的嵌套块。

首先,最好注释第43行$this->renderCategoriesMenuHtml();以恢复您的Magento商店,然后研究如何呈现类别菜单。