login to magento admin. Open any cms page and write block code in content section.
{{block class="Magento\Framework\View\Element\Template" name="test_file" template="Magento_Theme::test.phtml"}} After using the block code phtml file will be called on cms page but after Footer.
How can we call before footer
-
Can you let me know how you added the block to the cms page? Usually, it will be before the footer. You know you can edit the content in the admin. I mean, it's ordered like this Header, Content, and Footer.Aaron Wang– Aaron Wang2022年09月16日 17:33:12 +00:00Commented Sep 16, 2022 at 17:33
-
I added phtml file then i created new cms page and added below code {{block class="Magento\Framework\View\Element\Template" name="test_file" template="Magento_Theme::test.phtml"}} prnt.sc/RRuD32GqgXJPkiran– kiran2022年09月16日 18:30:46 +00:00Commented Sep 16, 2022 at 18:30
-
Ok, And it is added after the footer block?Aaron Wang– Aaron Wang2022年09月16日 18:47:46 +00:00Commented Sep 16, 2022 at 18:47
-
no prnt.sc/zrmq5zhQSr2Akiran– kiran2022年09月16日 19:05:45 +00:00Commented Sep 16, 2022 at 19:05
-
You don't understand. Is it added after the footer block?Aaron Wang– Aaron Wang2022年09月17日 03:49:59 +00:00Commented Sep 17, 2022 at 3:49
1 Answer 1
You can achieve this by adding the widget.
Add widget
Select Type (CMS Static Block)
Select Theme (Your Theme)
Widget Title
Assign to Store View
Click on Add Layout Update
Display on All Pages
Select Before Page footer from Container
Change the section to Widget Options
Select the Static Block
Click on Save.
Clear the cache and navigate your browser to view.
Now you can view your block before the page footer.
Explore related questions
See similar questions with these tags.