{"id":7229,"date":"2019-09-20T11:29:45","date_gmt":"2019-09-20T05:59:45","guid":{"rendered":"https:\/\/www.hiddentechies.com\/blog\/?p=7229"},"modified":"2019-09-27T11:51:13","modified_gmt":"2019-09-27T06:21:13","slug":"magento-2-call-template-block-cms-page-cms-static-block","status":"publish","type":"post","link":"https:\/\/www.hiddentechies.com\/blog\/magento-2\/magento-2-call-template-block-cms-page-cms-static-block\/","title":{"rendered":"Magento 2 &#8211; How to Call Template Block in any CMS Page or CMS Static Block"},"content":{"rendered":"<p>In this post I am going to explain how to to call template block in any CMS page or CMS static block.<\/p>\n<p>If you want to call template block in CMS page or CMS static block, then you can do it by below code.<\/p>\n<p>Suppose that we have a phtml file called mytemplate.phtml of module Ht_Mymodule.<\/p>\n<pre class=\"lang:default decode:true \">{{block class=\"Ht\\Mymodule\\Block\\Mymodule\" name=\"your_block_name\" template=\"Ht_Mymodule::mytemplate.phtml\"}}<\/pre>\n<p>If you want to use Magento 2 default template block then you can do it as below.<\/p>\n<pre class=\"lang:default decode:true \">{{block class=\"Magento\\Framework\\View\\Element\\Template\" name=\"your_block_name\" template=\"Ht_Mymodule::mytemplate.phtml\"}}<\/pre>\n<p>Thats it. Enjoy Magento 2!!<\/p>\n","protected":false},"excerpt":{"rendered":"<p>In this post I am going to explain how to to call template block in any CMS page or CMS static block. If you want to call template block in CMS page or CMS static block, then you can do it by below code. Suppose that we have a phtml file called mytemplate.phtml of module&#8230; <\/p>\n<div class=\"actions\"><a href=\"https:\/\/www.hiddentechies.com\/blog\/magento-2\/magento-2-call-template-block-cms-page-cms-static-block\/\">Continue Reading<\/a><\/div>\n","protected":false},"author":1,"featured_media":7327,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[59],"tags":[10,27],"_links":{"self":[{"href":"https:\/\/www.hiddentechies.com\/blog\/wp-json\/wp\/v2\/posts\/7229"}],"collection":[{"href":"https:\/\/www.hiddentechies.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.hiddentechies.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.hiddentechies.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.hiddentechies.com\/blog\/wp-json\/wp\/v2\/comments?post=7229"}],"version-history":[{"count":1,"href":"https:\/\/www.hiddentechies.com\/blog\/wp-json\/wp\/v2\/posts\/7229\/revisions"}],"predecessor-version":[{"id":7230,"href":"https:\/\/www.hiddentechies.com\/blog\/wp-json\/wp\/v2\/posts\/7229\/revisions\/7230"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.hiddentechies.com\/blog\/wp-json\/wp\/v2\/media\/7327"}],"wp:attachment":[{"href":"https:\/\/www.hiddentechies.com\/blog\/wp-json\/wp\/v2\/media?parent=7229"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.hiddentechies.com\/blog\/wp-json\/wp\/v2\/categories?post=7229"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.hiddentechies.com\/blog\/wp-json\/wp\/v2\/tags?post=7229"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}