1

I'm doing a admin module, but I do not get module tab appears in admin menu.

Here is my config.xml inside Company/LeadPEC/etc/config.xml

<?xml version="1.0"?>
<config>
  <modules>
    <company_leadpec>
      <version>0.1.0</version>
    </company_leadpec>
  </modules>
  <global>
    <helpers>
      <leadpec>
        <class>Company_Leadpec_Helper</class>
      </leadpec>
    </helpers>
  </global>
  <admin>
    <routers>
      <leadpec>
        <use>admin</use>
        <args>
          <module>Company_LeadPEC</module>
          <frontName>leadpec</frontName>
        </args>
      </leadpec>
    </routers>
  </admin>
  <adminhtml>
    <menu>
      <leadpec translate="title" module="LeadPEC">
        <title>Company LeadPEC</title>
        <sort_order>100</sort_order>
        <action>admin_leadpec/adminhtml_leadpec</action>
      </leadpec>
    </menu>
    <acl>
      <resources>
        <admin>
          <children>
            <leadpec translate="title" module="LeadPEC">
              <title>Company LeadPEC</title>
              <sort_order>100</sort_order>
            </leadpec>
          </children>
        </admin>
      </resources>
    </acl>
</config> 

Here is my controller in Company/LeadPEC/controllers/Adminhtml/LeadpecController.php

class Company_Leadpec_Adminhtml_LeadpecController extends Mage_Adminhtml_Controller_Action
{
        protected function _initAction()
        {
                $this->loadLayout()->_setActiveMenu("leadpec/leadpec")->_addBreadcrumb(Mage::helper("adminhtml")->__("Leadpec Manager"),Mage::helper("adminhtml")->__("Leadpec Manager"));
                return $this;
        }
        public function indexAction() 
        {
                $this->_title($this->__("Leadpec"));
                $this->_title($this->__("Manager Leadpec"));

                $this->_initAction();
                $this->renderLayout();
        }
}

Helper in Company/LeadPEC/Helper/Data.php

<?php
class Company_Leadpec_Helper_Data extends Mage_Core_Helper_Abstract
{
}

app/etc/modules/Company_LeadPEC.xml

<?xml version="1.0"?>
<config>
  <modules>
    <Company_LeadPEC>
      <active>true</active>
      <codePool>local</codePool>
      <version>0.1.0</version>
    </Company_LeadPEC>
  </modules>
</config>

Thank you!

2 Answers 2

0

In config.xml global helpers replace with below,

<global>
    <helpers>
      <leadpec>
        <class>Company_LeadPEC_Helper</class>
      </leadpec>
    </helpers>
  </global>

Controller in Company/LeadPEC/controllers/Adminhtml/LeadpecController.php

class Company_LeadPEC_Adminhtml_LeadpecController extends Mage_Adminhtml_Controller_Action
{
  protected function _initAction()
  {
          $this->loadLayout()->_setActiveMenu("leadpec/leadpec")->_addBreadcrumb(Mage::helper("adminhtml")->__("Leadpec Manager"),Mage::helper("adminhtml")->__("Leadpec Manager"));
          return $this;
  }
  public function indexAction() 
  {
          $this->_title($this->__("Leadpec"));
          $this->_title($this->__("Manager Leadpec"));

          $this->_initAction();
          $this->renderLayout();
  }
}

Helper in Company/LeadPEC/Helper/Data.php

<?php
class Company_LeadPEC_Helper_Data extends Mage_Core_Helper_Abstract
{
}

Seems to looklike issue with your LeadPEC character conflict in your module.

1
  • Thank you! This was a fail but it not solved my problem. Dec 15, 2017 at 9:47
0

I found your adminhtml tag is not closed

<?xml version="1.0"?>
<config>
  <modules>
    <company_leadpec>
      <version>0.1.0</version>
    </company_leadpec>
  </modules>
  <global>
    <helpers>
      <leadpec>
        <class>Company_Leadpec_Helper</class>
      </leadpec>
    </helpers>
  </global>
  <admin>
    <routers>
      <leadpec>
        <use>admin</use>
        <args>
          <module>Company_LeadPEC</module>
          <frontName>leadpec</frontName>
        </args>
      </leadpec>
    </routers>
  </admin>
  <adminhtml>
    <menu>
      <leadpec translate="title" module="LeadPEC">
        <title>Company LeadPEC</title>
        <sort_order>100</sort_order>
        <action>admin_leadpec/adminhtml_leadpec</action>
      </leadpec>
    </menu>
    <acl>
      <resources>
        <admin>
          <children>
            <leadpec translate="title" module="LeadPEC">
              <title>Company LeadPEC</title>
              <sort_order>100</sort_order>
            </leadpec>
          </children>
        </admin>
      </resources>
    </acl>
 </adminhtml>
</config> 

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.