0

There are two themes which i am using. One is magento theme 'Smartwave porto' and another is Ced commerce theme which i got for ced commerce extension. This theme is enabled only for this particular extension pages. I want to display footer block of my 'Porto theme' into Ced commerce extension theme. How can i do that. Remember i want to call the footer block from phtml file of ced commerce extension.

2
  • You want to call that footer in cms page or in phtml ?
    – PЯINCƎ
    Sep 25, 2019 at 10:58
  • @PЯINCƏ In phtml
    – Nafsss
    Sep 25, 2019 at 11:07

2 Answers 2

0

You can use like this way

{{block class="Magento\Framework\View\Element\Template" template="Porto_NameSpace::html/footer.phtml"}}
2
  • What should i put in class and template? Did you understand my question?In Porto theme i am calling footer block as <block class="Smartwave\Porto\Block\Template" name="footer_block" template="html/footer.phtml">. Do i need to provide same class name and template path in other theme phtml file or something else
    – Nafsss
    Sep 26, 2019 at 8:41
  • yes you can use like this way
    – Jinesh
    Sep 26, 2019 at 15:24
0

You have to copy it from Porto theme to Ced commerce example : footer2.phtml, then you get it simply like this :

<?php echo $block->getLayout()->createBlock('Magento\Framework\View\Element\Template')->setTemplate('Magento_Theme::footer2.phtml')->toHtml(); ?>
4
  • @Prince getting error Invalid template file: 'Smartwave_Porto::html/footer.phtml' in module: '' block's name: 'magento\framework\view\element\template_0'
    – Nafsss
    Sep 25, 2019 at 11:40
  • In Porto theme i am calling footer block as <block class="Smartwave\Porto\Block\Template" name="footer_block" template="html/footer.phtml">. Do i need to provide same class name and template path in other theme phtml file or something else
    – Nafsss
    Sep 25, 2019 at 11:42
  • If this footer don't inherits Magento\Framework\View\Element\Template it becomes complicated, try to replace : createBlock('Magento\Framework\View\Element\Template') with createBlock('Smartwave\Porto\Block\Template')
    – PЯINCƎ
    Sep 25, 2019 at 12:21
  • @Prince Did that too...but getting error
    – Nafsss
    Sep 26, 2019 at 5:17

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.