0

I have a custom module where I have added some custom links in the customer's account. The custom page in the customer account's links redirects to a new page on clicking a particular link. I have also created the new page, but the issue is that the new page is not a part of the customer account page anymore but instead is a completely new page in Magento frontend.

I have added the link as,

in layout/customer_account.xml

        <referenceBlock name="customer_account_navigation">
        <block class="Magento\Framework\View\Element\Html\Link\Current" name="customer-account-navigation-my-quotes-link" after="-">
            <arguments>
                <argument name="path" xsi:type="string">path/to/link</argument>
                <argument name="label" xsi:type="string">My link</argument>
            </arguments>
        </block>
    </referenceBlock>

My layout file,

<?xml version="1.0"?>
<page layout = "1column" 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>
    <referenceBlock name="page.main.title">
        <action method="setPageTitle">
            <argument translate="true" name="title" xsi:type="string">My Title</argument>
        </action>
    </referenceBlock>
    <referenceContainer name = "content">
        <block class = "Path\To\Block\Class" name = "name" template = "Vendor_Module::my.phtml" cacheable="false"/>
        <block class = "Path\To\Second\Block\Class" name = "name1" template = "Vendor_Module::second.phtml"/>
    </referenceContainer>
</body>

So as above, when we click on "My link", it displays a custom page that directs to a new custom page. However, in the new page, there are no customer account's links. How can I achieve this? Please help.

I have referred these links: Magento 2 Custom Customer Account Link Created but that related phtml is coming with out navigeation links on left side?

Dashboard links not showing my Custom Form in Magento 2

But they don't seem to work for me.

  • Make Your Page Layout to 2column-left or 2column-right @manini – Learing_Coder Jun 1 '17 at 5:08
0

Make this changes in your layout file

<?xml version="1.0"?>
<page layout = "2column-left" xmlns:xsi = "http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation = "urn:magento:framework:View/Layout/etc/page_configuration.xsd">
<update handle="customer_account"/>
// code goes here ***********
</body>

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.