Proper way to get $block->getChildHtml inside the custom phtml file

I want to add default wishlist sidebar section into my Magento_Theme template,

Layout xml file file:

 <referenceBlock name="header.panel"> <block class="MagentoFrameworkViewElementTemplate" name="mylocation.block" template="Magento_Theme::location_link.phtml" after="-"> <!-- Wishlist sidebar section --> <block class="MagentoWishlistBlockCustomerSidebar" name="wishlist_sidebar" as="wishlist" template="Magento_Wishlist::sidebar.phtml"/> </block> </referenceBlock> 

FYI : The following code coming from core vendormagentomodule-wishlistviewfrontendtemplatessidebar.phtml

 <!-- Wishlist sidebar section --> <block class="MagentoWishlistBlockCustomerSidebar" name="wishlist_sidebar" as="wishlist" template="Magento_Wishlist::sidebar.phtml"/> 

After added in layout xml file and getting this block using getChildHtml in appdesighfrontendZeromy_themeMagento_Themetemplateslocation_link.phtml

<?php echo $block->getChildHtml('wishlist');?> 

Not working, any help thanks.

submitted by /u/aveeva7
[link] [comments]