我正在尋找一些建議或有關如何執行以下操作的信息。我想在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