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 Answers
You can use like this way
{{block class="Magento\Framework\View\Element\Template" template="Porto_NameSpace::html/footer.phtml"}}
-
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– NafsssSep 26, 2019 at 8:41
-
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(); ?>
-
@Prince getting error Invalid template file: 'Smartwave_Porto::html/footer.phtml' in module: '' block's name: 'magento\framework\view\element\template_0'– NafsssSep 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– NafsssSep 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')
withcreateBlock('Smartwave\Porto\Block\Template')
– PЯINCƎSep 25, 2019 at 12:21 -