below the account navigation is there an easy way for a newbie to add an image pointing to a page in the magento2? This account navigation appears on the side of my account dashboard. thanks!
- 
 Here, you have to do so many things to show a profile image. I suggest you to check this extension: marketplace.magento.com/sy-avatar.htmlRavi Soni– Ravi Soni2019年06月28日 05:32:57 +00:00Commented Jun 28, 2019 at 5:32
- 
 add code of inserting image in account informationRonak Rathod– Ronak Rathod2019年06月28日 06:37:46 +00:00Commented Jun 28, 2019 at 6:37
1 Answer 1
For the add image and there link in the below myaccount navigation dashboard.
Follow below steps.
File path: magento/app/design/frontend/Namespace/theme/Magento_Customer/layout/customer_account.xml
<?xml version="1.0"?>
<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>
 <block class="Magento\Framework\View\Element\Template" name="new-sidebar-image-block" template="Magento_Customer::imageblock.phtml"/>
 </body>
</page>
File path: magento/app/design/frontend/Namespace/theme/Magento_Customer/templates/imageblock.phtml
<a href="<?php echo $block->getUrl()?>customer/account/" target="_self"><img src="<?php echo $block->getUrl("pub/media/myaccount/")?>image.png"/></a>
Put your image to below path:
pub/media/myaccount/image.png
Now run the command php bin/magento cache:flush
Check in myaccount image will appear.
Hope it help.
- 
 thanks. I'm curios about the path,magento/app/design/frontend/Namespace/theme/Magento_Customer/layout/customer_account.xml. I'm currently using template monster from a vendor so would this still work or should I find my templates customer_account.xml instead?Ahdee– Ahdee2019年06月28日 15:14:34 +00:00Commented Jun 28, 2019 at 15:14
- 
 It's works. Check and let me know if any issue.Kirti Nariya– Kirti Nariya2019年06月28日 16:20:48 +00:00Commented Jun 28, 2019 at 16:20
- 
 so I tried this but its not working. Currently I have two subfolders below /app/design/frontend they are Magento and templatemonster. I tried two ways, first I made a seperate folder called test and put./test/Magento_Customer/layout/customer_account.xmlbut that did not work so I tried putting it under the subfolder magento but did not work as well. Any other place I should try?Ahdee– Ahdee2019年07月05日 00:02:37 +00:00Commented Jul 5, 2019 at 0:02
- 
 You have to need place the customer_account.xml in your theme below path. app/design/frontend/templatemonster/yourtheme/Magento_Customer/layout/customer_account.xmlKirti Nariya– Kirti Nariya2019年07月05日 04:37:50 +00:00Commented Jul 5, 2019 at 4:37
- 
 Ok hmm I tried this. I also went ahead and do a flush as well as magento setup:upgrade; but its still not showing up. Do I need to register/initiate the custom template somewhere perhaps.Ahdee– Ahdee2019年07月06日 03:01:16 +00:00Commented Jul 6, 2019 at 3:01
Explore related questions
See similar questions with these tags.