0

Is there any way to insert custom block in CMS page in Magento 2.2 alike inserting CMS block in CMS page?

1
  • You can call phtml file in cms page that contains specific block...Do u asking like this? Oct 7, 2017 at 11:49

1 Answer 1

0

If I get you right about custom block (template.phtml), you need to create custom template in (for example) app/code/<Package>/<Module>/view/frontend/templates/cms/customTemplate.phtml and then insert this template in a CMS Page via layout update (in admin panel):

<referenceContainer name="content">
    <block class="Magento\Framework\View\Element\Template" name="your.custom.name" template="<Package>_<Module>::cms/customTemplate.phtml" before="-" />
</referenceContainer>

Your Answer

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

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