0

I made a page using admin side. and I want to assign this file which I already used on Product description page . in catalog_product_view.xml

like this

<block class="Magento\Catalog\Block\Product\View\Description" name="product.details.accessories" template="product/view/accessories.phtml" after="product.info.details" />

How I can use this accessories.phtml now on my page which I made using admin side ?

2 Answers 2

1

This is called like:-

{{block class="[BlockClassFullName]" template="[VendorName]_[ModuleName]::[YourTemplateFileLocation].phtml"}} 

For your case will be:-

{{block class="Magento\Framework\View\Element\Template" template="[VendorName]_[ModuleName]::product/view/accessories.phtml"}} 
2
  • its in app/design/frontend/magento/hair/Magento_Catalog/templates/product/view/accessories.phtml . So what will [VendorName]_[ModuleName] ?
    – Learner
    Commented Jan 23, 2018 at 9:41
  • Magento_Catalog::product/view/accessories.phtml ? like this ?
    – Learner
    Commented Jan 23, 2018 at 9:42
0

in cms page you can call template and block by this

 {{block class="Your Class" template="your Template Path"}}

But in your case this will not work because this class requires $_product and this has to be set in this block so in your case if you use this code it will give you fatal error

1
  • So there is no way to get this on admin side @Murtuza
    – Learner
    Commented Jan 24, 2018 at 8:12

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.