Check the below files to create a customer account navigation link.
app/code/Bluethinkin/Customermenu/registration.php
1 2 3 4 5 |
<?php use Magento\Framework\Component\ComponentRegistrar; ComponentRegistrar::register(ComponentRegistrar::MODULE, 'Bluethinkinc_Customermenu', __DIR__); ?> |
app/code/Bluethinkinc/Customermenu/etc/module.xml
1 2 3 4 5 6 7 8 9 10 11 |
<?xml version="1.0"?> <config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Module/etc/module.xsd"> <module name="Bluethinkinc_Customermenu" setup_version="1.0.0"> </module> </config> |
app/code/Bluethinkinc/Customermenu/etc/frontend/routes.xml
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 |
<?xml version="1.0" ?> <config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:App/etc/routes.xsd"> <router id="standard"> <route frontName="customermenu" id="customermenu"> <module name="Bluethinkinc_Customermenu"/> </route> </router> </config> |
app/code/Bluethinkinc/Customermenu/view/frontend/layout/customer_account.xml
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 |
<?xml version="1.0"?> <!-- /** * Copyright © Magento, Inc. All rights reserved. * See COPYING.txt for license details. */ --> <page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd"> <body> <referenceBlock name="customer_account_navigation"> <block class="Magento\Framework\View\Element\Html\Link\Current" name="bluethinkinc_customermenu_custom_my_account"> <arguments> <argument name="path" xsi:type="string">customermenu/account/custompage</argument> <argument name="label" xsi:type="string">My custom</argument> <argument name="sortOrder" xsi:type="number">150</argument> <argument name="navigation" xsi:type="boolean">true</argument> </arguments> </block> </referenceBlock> </body> </page> |
app/code/Bluethinkinc/Customermenu/Controller/Account/Custompage.php
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 |
<?php namespace Bluethinkinc\Customermenu\Controller\Account; use Magento\Framework\View\Result\PageFactory; use Magento\Framework\App\Action\Context; class Custompage extends \Magento\Customer\Controller\AbstractAccount { /** * @var PageFactory */ protected $resultPageFactory; /** * @param Context $context * @param PageFactory $resultPageFactory * @param \Magento\Framework\Controller\Result\ForwardFactory $resultForwardFactory */ public function __construct( Context $context, PageFactory $resultPageFactory ) { $this->resultPageFactory = $resultPageFactory; parent::__construct($context); } /** * @return \Magento\Framework\View\Result\Page */ public function execute() { /** @var \Magento\Framework\View\Result\Page $resultPage */ $resultPage = $this->resultPageFactory->create(); $resultPage->getConfig()->getTitle()->set(__('My Custom')); return $resultPage; } } |
app/code/Bluethnkinc/Customermenu/view/frontend/layout/customermenu_account_custompage.xml
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 |
<?xml version="1.0"?> <!-- /** * Copyright © Magento, Inc. All rights reserved. * See COPYING.txt for license details. */ --> <page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd"> <update handle="customer_account"/> <body> <referenceContainer name="content"> <block class="Magento\Framework\View\Element\Template" name="bluethinkinc_customermenu_custom_my_account_content" template="Bluethinkinc_Customermenu::customtemplate.phtml"/> </referenceContainer> </body> </page> |
app/code/Bluethinkinc/Customermenu/view/frontend/templates/customtemplate.phtml
1 2 3 4 5 |
<div> <h2>Hello BluethinkInc</h2> </div> |
Frontend View
Find More Blogs
Understanding Database Allows Callout in Salesforce Apex
Spread the love In Salesforce, the Database.AllowsCallouts
PODMAN
Spread the love 1.Introduction Podman: The Modern Container
Running Your Java Program (JAR) 24/7 on AWS EC2 Automatically
Spread the love Introduction Running a Java application
Building a REST API with Spring Boot
Spread the love Introduction REST (Representational State
Custom API to Fetch Customer Data by Customer ID in Spryker
Spread the love Introduction In this blog post, we will
Creating a Custom Module for a Custom Frontend Page in Spryker
Spread the love To create a custom module for a custom
How to create custom module api get category list without access token in Spryker
Spread the love To create a custom API for fetching a
Creating a Custom Glue API in Spryker
Spread the love Spryker’s Glue API is a powerful tool
Get AI Generated 360-Degree View of Account Summary in Dynamics 365 Sales
Spread the love Navigating the demanding landscape of sales
Enhancing Productivity with Dynamics 365: The Power of Session Restore
Spread the love Enhancing Productivity with Dynamics 365:

bluethinkinc_blog
2023-09-19