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.
-
You want to call that footer in cms page or in phtml ?PЯINCƎ– PЯINCƎ ♦2019年09月25日 10:58:35 +00:00Commented Sep 25, 2019 at 10:58
-
@PЯINCƏ In phtmlNafsss– Nafsss2019年09月25日 11:07:25 +00:00Commented Sep 25, 2019 at 11:07
2 Answers 2
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 elseNafsss– Nafsss2019年09月26日 08:41:23 +00:00Commented Sep 26, 2019 at 8:41
-
yes you can use like this wayJinesh– Jinesh2019年09月26日 15:24:21 +00:00Commented Sep 26, 2019 at 15:24
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'Nafsss– Nafsss2019年09月25日 11:40:21 +00:00Commented 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 elseNafsss– Nafsss2019年09月25日 11:42:28 +00:00Commented Sep 25, 2019 at 11:42
-
If this footer don't inherits
Magento\Framework\View\Element\Templateit becomes complicated, try to replace :createBlock('Magento\Framework\View\Element\Template')withcreateBlock('Smartwave\Porto\Block\Template')2019年09月25日 12:21:32 +00:00Commented Sep 25, 2019 at 12:21 -
@Prince Did that too...but getting errorNafsss– Nafsss2019年09月26日 05:17:13 +00:00Commented Sep 26, 2019 at 5:17