I want to add a custom tab on account dashboard in Magento2 and I have seen many tutorials for creating new module but not one showing exact location for placing that module.

Right now I have placed my custom module on this path app/code folder but it is not working.

I have followed this tutorial for creating a new module,


Anyone can help to know the exact location for placing module.

  • Please check my updated answer and let me know if its helpful for you or not May 8, 2018 at 10:35

4 Answers 4


Follow the steps listed below :

Add below files into your custom extension.

Ex:- => Namespace:- ABC => modulename : Myblog

=> Create customer_account.xml into ABC/Myblog/view/frontend/layout

<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
      <referenceBlock name="customer_account_navigation">
         <block class="Magento\Framework\View\Element\Html\Link\Current" name="customer-account-navigation-myblog">
               <argument name="path" xsi:type="string">myblog/customer/index</argument>
               <argument name="label" xsi:type="string"> My Blog</argument>

=> Create myblog_customer_index.xml into ABC/Myblog/view/frontend/layout

<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../lib/internal/Magento/Framework/View/Layout/etc/page_configuration.xsd"> 
<update handle="customer_account"/> 
    <referenceBlock name="page.main.title"> 
            <action method="setPageTitle"> 
                <argument translate="true" name="title" xsi:type="string">My Blog</argument> 
     <referenceContainer name="content"> 
        <block class="Magento\Framework\View\Element\Template" name="my_email" template="ABC_Myblog::myblog.phtml"> 

=> Create Index.php into ABC/Myblog/Controller/Customer

namespace ABC\Myblog\Controller\Customer;  
class Index extends \Magento\Framework\App\Action\Action { 

 public function execute() { 



=> Create myblog.phtml into ABC/Myblog/view/frontend/templates

 // Add Some Code Here  
  • thanks for your code , but i have created same type of code and added module on app/code directory but nothing showing on frontend May 8, 2018 at 11:30
  • remove var and generated folder...and try it. May 8, 2018 at 11:48
  • ok what is ABC in this ? where i need to add this after create? in app/code folder ? May 8, 2018 at 13:52
  • Its like app/code/ABC/Myblog May 8, 2018 at 15:02
  • Create ABC folder into app/code and then Create Myblog folder into app/code/ABC folder May 8, 2018 at 15:03

so finally I have created the module for add new tab. if anybody wants then download from here https://www.dropbox.com/s/23yt71gdh8xdbv9/Privacy.zip?dl=0 and activate module with the command

php bin/magento module:enable Privacy_Policy

You have to add your module to app/code.
After that run command php bin/magento setup:upgrade, php bin/magento setup:static-content:deploy -f and php bin/magento cache:flush from CLI.

  • i have run same command from putty , but still nothing showing on frontend May 8, 2018 at 11:29
  • Try running php bin/magento setup:static-content:deploy -f and php bin/magento cache:flush as well May 8, 2018 at 11:51
  • after running these command my paid paid plugin start showing in admin but custom module still not showing, is this right location app/code for place module ? May 8, 2018 at 14:06
  • Yes, the location is correct. Kindly share your code, may be there is some issue in the code. May 9, 2018 at 5:07
  • 1. as i already mentioned, i have follow magecomp.com/blog/… article and created module , i have not done any changes yet in article code. 2. i need to call this module anywhere ? or it should auto work after uploading ? May 9, 2018 at 5:50

I often use a skeleton I get from here:


Which takes out a lot of the grunt and setup work (be sure to verify whether everything in registration.php and such is accurate).

Magento modules have a Vendor name and a Module name. For example, my company is called Company, and I made a module to handle pricelists of our catalog, so the module is called Pricelist.

My module is placed so the file path looks like app/code/Company/Pricelist/...(module files)

After putting the files correctly, run (with the same folder that contains the app folder as the working directory) php bin/magento setup:upgrade. If you log in as admin, you'll be able to see your new module under Stores/Configuration/Advanced/Admin. It should show as enabled.

In the same folder, now run php bin/magento setup:di:compile

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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