2

I have Created a link in account dashboard it is visible as shown in screen

shot below

enter image description here

when I click on the link it is showing just like these in the screenshot below

http://www.awesomescreenshot.com/image/2552811/5e81668539016e4f9622033455c999d0

But I need on clicking my custom link I need show the content as shown in the

screen shot below

http://www.awesomescreenshot.com/image/2552815/afa2f32d0f2be63d2596e75ae53626c1

Layout Xml File

app/code/Custom/Customerdashboard/view/frontend/layout/customerdashboard_index_index.xml

code:

<page layout="2columns-left" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../lib/internal/Magento/Framework/View/Layout/etc/page_configuration.xsd">
    <body>
        <referenceContainer name="content">
            <block class="Custom\Customerdashboard\Block\Index\Index" name="customerdashboard_index_index" template="customerdashboard_index_index.phtml"/>
        </referenceContainer>
    </body>
</page>

Please can Anyone help Me

Thanks In advance.

  • Share your demo page code in question. – Prince Patel Jun 3 '17 at 6:07
  • Please check i Have updated the code in question @PrincePatel – Learing_Coder Jun 3 '17 at 6:26
  • Did you get my answer? – Prince Patel Jun 3 '17 at 7:49
4

You Have to put these code in your Custom xml file

File Path:app/code/Custom/Customerdashboard/view/frontend/layout/customerdashboard_index_index.xml

<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" layout="2columns-left" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd" label="Customer My Account (All Pages)" design_abstraction="custom">
        <body>
        <referenceContainer name="content">
        <block class="Custom\Customerdashboard\Block\Index\Index" name="customerdashboard_index_index" template="customerdashboard_index_index.phtml"/>
        </referenceContainer>   
        <referenceContainer name="sidebar.main">  
        <block class="Magento\Framework\View\Element\Template" name="customer_account_navigation_block" template="Magento_Theme::html/collapsible.phtml" before="-">
                    <arguments>
                        <argument name="block_title" translate="true" xsi:type="string">Account Dashboard</argument>
                        <argument name="block_css" xsi:type="string">block-collapsible-nav</argument>
                    </arguments>
                    <block class="Magento\Framework\View\Element\Html\Links" name="customer_account_navigation" before="-">
                        <arguments>
                            <argument name="css_class" xsi:type="string">nav items</argument>
                        </arguments>
                        <block class="Magento\Framework\View\Element\Html\Link\Current" name="customer-account-navigation-account-link">
                            <arguments>
                                <argument name="label" xsi:type="string" translate="true">Account Dashboard</argument>
                                <argument name="path" xsi:type="string">customer/account</argument>
                            </arguments>
                        </block>
                        <block class="Magento\Framework\View\Element\Html\Link\Current" name="customer-account-navigation-account-edit-link">
                            <arguments>
                                <argument name="label" xsi:type="string" translate="true">Account Information</argument>
                                <argument name="path" xsi:type="string">customer/account/edit</argument>
                            </arguments>
                        </block>
                        <block class="Magento\Framework\View\Element\Html\Link\Current" name="customer-account-navigation-address-link">
                            <arguments>
                                <argument name="label" xsi:type="string" translate="true">Address Book</argument>
                                <argument name="path" xsi:type="string">customer/address</argument>
                            </arguments>
                        </block>
                </referenceContainer>
        <move element="page.main.title" destination="content.top" before="-"/>
    </body>
</page>
0

You cat just add this to your layout file:

<update handle="customer_account"/>

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.