我正在寻找一些建议或有关如何执行以下操作的信息。我想在magento管理面板中添加一个菜单。我尝试了很多方法,但没有工作。我如何在管理面板中添加额外的一个菜单。请告知...如何在magento管理面板中添加菜单?
回答
我创建一个模块。
信息 - 公司名称的文件夹
ExtendedMenu - 模块名称
我创建模块文件夹2个新文件夹。
等&座
etc文件夹,我创建config.xml文件
<?xml version="1.0" encoding="UTF-8"?>
<config>
<modules>
<Info_ExtendedMenu>
<version>0.1.0</version>
</Info_ExtendedMenu>
</modules>
<global>
<blocks>
<configurable>
<class>Info_Configurable_Block</class>
</configurable>
<adminhtml>
<rewrite>
<page_menu>Info_ExtendedMenu_Block_Adminhtml_Menu</page_menu>
</rewrite>
</adminhtml>
</blocks>
<blocks>
<configurable>
<class>Inchoo_Configurable_Block</class>
</configurable>
</blocks>
</global>
</config>
块 - Adminhtml - Menu.php
<?php
class Info_ExtendedMenu_Block_Adminhtml_Menu extends Mage_Adminhtml_Block_Page_Menu
{
public function getMenuArray()
{
//Load standard menu
$parentArr = parent::getMenuArray();
//Prepare "View Sites" menu
$parentArr['view_sites'] = array(
'label' => 'Web2Print',
'active'=>false ,
'sort_order'=>0,
'click' => 'return false;',
'url'=>'#',
'level'=>0,
'last'=> true,
'children' => array()
);
$app = Mage::app();
$j = 0;
$allWebsites = $app->getWebsites();
$totalWebsiteCount = count($allWebsites) - 1;
foreach ($allWebsites as $_eachWebsiteId => $websiteVal){
$_storeName = $app->getWebsite($_eachWebsiteId)->getName();
$baseUrl = $app->getStore($_eachStoreId)->getUrl();
$_websiteUrl = array(
'label' => 'View Admin',
'active' => false ,
'click' => "var extraurl='w2p/admin/index.php';alert(this.href+extraurl); window.open(this.href+extraurl, 'Website - '+ this.href); return false;",
'sort_order' => $i++ * 10,
'level' => 2,
'url' => $baseUrl
);
if(count($parentArr['view_sites']['children']) == $totalWebsiteCount){
$_websiteUrl['last'] = true;
} else {
$_websiteUrl['last'] = false;
}
$parentArr['view_sites']['children'][$j - 1] = $_websiteUrl;
$allStores = $app->getWebsite($app->getWebsite($_eachWebsiteId)->getId())->getStores();
$totalCount = count($allStores);
$i = 0;
foreach ($allStores as $_eachStoreId => $val){
$_websiteId = $app->getStore($_eachStoreId)->getWebsiteId();
if($_websiteId == $j){
$_storeName = 'View Admin';
$baseUrl = $app->getStore($_eachStoreId)->getUrl();
$_websiteUrl = array(
'label' => $_storeName,
'active' => false ,
'click' => "var extraurl='w2p/admin/index.php';alert(this.href+extraurl); window.open(this.href+extraurl, 'Website - '+ this.href); return false;",
'sort_order' => $i++ * 10,
'level' => 2,
'url' => $baseUrl
);
if(count($parentArr['view_sites']['children'][$j - 1]['children']) + 1 == $totalCount or $totalCount == 0)
$_websiteUrl['last'] = true;
else
$_websiteUrl['last'] = false;
$parentArr['view_sites']['children'][$j - 1]['children'][$i] = $_websiteUrl;
}
}
}
return $parentArr;
}
}
你也需要去Magento的基地文件夹路径app-etc-modules-youemodule名称(Inchoo_ExtendedMenu.xml)
<?xml version="1.0"?>
<config>
<modules>
<Inchoo_ExtendedMenu>
<active>true</active>
<codePool>local</codePool>
</Inchoo_ExtendedMenu>
</modules>
</config>
菜单创建结束。干杯。
什么菜单?你在谈论延期吗?
为了做到这一点,你必须:System > Magento connect > Magento connect manager
编辑:
即使世界的延伸来管理这个,一起来看看:Custom Menu Magento
嗨@Flowen我需要在magento 1.7.0.2中创建自定义菜单模块。我如何创建模块请指教 – 2013-04-24 08:34:25
编辑,看看这个扩展 – Flowen 2013-04-24 08:42:30
我安装在magento v 1.7.0.2但致命的错误:类'WP_CustomMenu_Helper_Data'找不到D:\ xampp \ htdocs \ projects \ magento \ app \ Mage.php在线547请指导我 – 2013-04-24 09:33:26
如果这是你的自定义模块,你需要什么要做的是在etc/config.xml中添加如下内容:
<adminhtml>
<menu>
<report>
<children>
<module name>
<title>Title to show in the menu bar</title>
<sort_order>0</sort_order>
<action>Modules controller action</action>
</module name>
</children>
</report>
</menu>
</adminhtml>
ex充足的上面会添加一个新的项目到报告标签,并在控制器中触发一个动作来做某件事。希望这可以帮助。
仍然适用于1.9 – TT120 2016-04-18 11:48:45
您可以使用自定义模块 添加菜单下面的教程帮助了我很多 请点击here
- 1. 如何在菜单项管理面板中添加一些内容Magento
- 2. Magento:添加到管理菜单
- 3. 在SocialEngine管理面板中添加新菜单
- 4. 如何隐藏管理面板中的管理菜单
- 5. 如何在OSCmax中添加子菜单项的管理菜单?
- 6. 在管理面板中添加一些HTML magento
- 7. 在magento管理面板中添加一个新的字体
- 8. 如何在magento管理端添加新产品添加页面?
- 9. wordpress - 添加新的基于管理面板菜单选项卡
- 10. 在WordPress管理中添加菜单
- 11. 如何在Magento管理面板中的网格行添加按钮?
- 12. 如何覆盖Magento管理面板?
- 13. Magento为管理面板中的电话号码添加验证
- 14. Magento管理面板定制
- 15. Magento管理面板损坏
- 16. 如何添加WordPress管理页面而不将其添加到菜单中?
- 17. django grappelli管理面板菜单
- 18. 如何复制wordpress管理面板中的分类子菜单
- 19. 显示在Magento管理面板
- 20. 如何在管理菜单页面中添加/更新帖子元?
- 21. 如何添加内容块到magento管理仪表板?
- 22. 在Magento菜单中添加链接
- 23. 如何在magento管理面板中显示当前时间?
- 24. 如何在magento管理面板中隐藏产品价格
- 25. 如何在magento的管理面板中为所有业务单元添加过滤器1.6.2
- 26. 在magento的管理面板中添加特殊价格的新列
- 27. 仪表板菜单是不是在我的管理面板wordpress
- 28. 试图添加搜索栏管理面板菜单栏搜索woocommerce产品
- 29. 如何移动Magento中的管理菜单项目
- 30. magento删除管理菜单项
,我不知道你的答案工作正常或没有,因为我没有尝试这个。但我对你的账户有一个疑问。请参阅本网站http://meta.stackexchange.com/questions/190267/why-does-this-user-have-posts-that-appear-to-be-older-than-their-account#190267 – DRAJI 2013-07-25 05:48:29
Hi @ DRAJI你的疑问已被清除?或检查你的链接http://meta.stackexchange.com/questions/190267/why-does-this-user-have-posts-that-appear-to-be-older-than-their-account#190267 – 2013-07-26 05:56:11