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.

asked Sep 25, 2019 at 10:43
2
  • You want to call that footer in cms page or in phtml ? Commented Sep 25, 2019 at 10:58
  • @PЯINCƏ In phtml Commented 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"}}
answered Sep 25, 2019 at 10:51
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 Commented Sep 26, 2019 at 8:41
  • yes you can use like this way Commented 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(); ?>
answered Sep 25, 2019 at 11:20
4
  • @Prince getting error Invalid template file: 'Smartwave_Porto::html/footer.phtml' in module: '' block's name: 'magento\framework\view\element\template_0' Commented 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 Commented 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') Commented Sep 25, 2019 at 12:21
  • @Prince Did that too...but getting error Commented Sep 26, 2019 at 5:17

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

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

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.