2012-02-14 57 views
1

我对管理菜单项具有以下配置。我希望菜单项链接包含一个散列以直接转到相应的组。是否可以使用config.xml在管理菜单链接中添加散列?

<adminhtml> 
    <menu> 
     <theme module="theme" translate="title"> 
      <title>Theme</title> 
      <sort_order>71</sort_order>    
      <children> 
       <configuration module="theme" translate="title"> 
        <title>Configuration</title> 
        <sort_order>3</sort_order> 
        <action>adminhtml/system_config/edit/section/design</action> 
       </configuration> 
      </children> 
     </theme> 
    </menu> 
<adminhtml> 

例如,我想链接到

adminhtml/system_config/edit/section/design#theme 

这可能使用config.xml吗?如果不是,那么最简单的方法是什么?

回答

1

顶部菜单的URL使用此代码内置:

Mage::getModel('adminhtml/url')->getUrl((string)$child->action, array('_cache_secret_key' => true) 

这意味着它是不可能的附加参数或锚添加到生成的URL。

可能的解决方案将包括重写块类adminhtml/page_menu并评估附加标记,例如,称为<params>
另一种可能性是使用JavaScript重写该链接的URL。

0

我认为更好的解决方案将是简单的重定向,而不是重写核心文件或JavaScript。只需添加URL重定向到所需的页面使用参数:

adminhtml.xml:<action>mymodule/adminhtml_controller/redirecttoproduct</action>

在你的文件位指示:

public function redirecttoproductAction(){ 
    return $this->_redirect('adminhtml/catalog_product/edit', array(
     'id' => 168, 
     'tab' => 'product_info_tabs_group_95' 
    )); 
} 
相关问题