61

I had this problem with EE 1.14.2 and it looks like the same issue has come up in CE 1.9.2. I documented my problem and solution on this SE question. Basically due to the following code being added to the constructor of Mage_Cms_Block_Block: $this->setCacheTags(array(Mage_Cms_Model_Block::CACHE_TAG)); $this->setCacheLifetime(false); CMS static ...


50

If you want to call static block in page Try below code : {{block class="Magento\\Cms\\Block\\Block" block_id="block_identifier"}} If you want to call in phtml file : Try below code : <?php echo $block->getLayout()->createBlock(\Magento\Cms\Block\Block::class)->setBlockId('block_identifier')->toHtml();?> Your xml file code should be :...


45

You can use the below code: in .phtml file : <?php echo $this->getLayout()->createBlock('cms/block')->setBlockId('block_identifier')->toHtml(); ?> sample : <?php echo $this->getLayout()->createBlock('cms/block')->setBlockId('home')->toHtml(); ?> in static block / cms page : {{block type="core/template" template="...


39

You can add current store URL in static block. {{store url=""}} If you wanto add store url with category URL. {{store url="category-url"}}


36

Try below code in cms page, If you want to call phtml with in cms page. {{block class="Magento\Bannerslider\Block\Slideshow" template="Magento_Bannerslider::bannerslider.phtml"}}


27

getBlockHtml('block_name_here') get's you the html of the block with name block_name_here if it finds it in the layout...anywhere. getChildHtml('block_name_here') get's you the html of the block with name block_name_here only if that block is a child of the current block. Here is an example. Consider the next layout section <block type="core/template" ...


27

I may be totally wrong, but you can call it like this {{block type="cms/block" block_id="home_image-center"}} in cms -> homepage-> content : in that click show/hideeditor past above code it's work


27

My understanding is that CE 1.9.2.2 includes all the changes from the recent-patch SUPEE-6788, one of which was restrict the blocks that can be used in CMS blocks, pages, emails (etc...) by default. Fortunately you can whitelist additional blocks through the admin under System > Permissions > (Blocks | Variables)


23

You don't need to create a module at all. You can use Widgets in Magento 1.4+: Click on CMS > Widgets: Click on "Add a new Widget Instance": Select "CMS Static Block" and the name of your theme: Then, under 'frontend properties' give it a title and click "Add Layout Update", and configure it as shown to display only on the home page in the main content ...


21

In magento,if you want to add block class in cms page, then you can tre below code {{block class="Magento\Bannerslider\Block\Slideshow" template="Magento_Bannerslider::bannerslider.phtml"}} Formula is : {{block class="[BlockClassFullName]" template="[VendorName]_[ModuleName]::[YourTemplateFileLocation].phtml"}} Default block: {{block class="Magento\...


20

I used below method: System > Permissions > Blocks Add New Block Block Name: cms/block Is Allowed : Yes This seems to have done the trick for me.


18

As described on Stackoverflow <?php echo $this->getLayout()->createBlock('cms/block')->setBlockId('block_identifier')->toHtml(); ?>


17

You can get base url in static block like this. <a href="{{store direct_url="business"}}">Your link</a>


16

You can call theme images from static block like this in magento2 : <img src="{{view url="images/demo.jpg"}}" alt=""/>


14

You don't need to include the theme's directory in the template path, Magento will automatically use the current theme and fallback structure. For example: {{block type="core/template" template="page/html/home.phtml"}} Or in your case: {{block type="core/template" template="custom/custom.phtml"}}


14

You can use Magento\Framework\View\Element\Template class to call phtml files {{block class="Magento\Framework\View\Element\Template" template="Vendor_Module::myfiles/myfile.phtml"}} To call advanced form use Magento\CatalogSearch\Block\Advanced\Form block class. {{block class="Magento\CatalogSearch\Block\Advanced\Form" name="block_name" template="...


13

I just upgraded to 1.9.2.0 and I'm experiencing this too. Categories that are set to display Static Blocks + Products are randomly displaying the wrong Static Block. This did not exist prior to my 1.9.2.0 upgrade. Temporary Fix Disable the Blocks HTML output cache and the blocks displayed are correctly.


13

Here we go with local module based solution as above solution does not provide whole steps. We need to create Custom module because you all know that Magento Boogieman will get you! if change the core :) You will need to following files: app/etc/modules/Bhupendra_Cms.xml <?xml version="1.0"?> <config> <modules> <...


12

It is a late reply, but i will share. It is true that you can do it all from admin. You can add any static block to any cms page directly from admin as a widget. Open the CMS page and then click on content tab. At top click on Insert Widget... button. You will have the following window. In the drop down, select CMS Static Block. Then you will have the ...


11

Let me give you an example, if you want to define a homepage for your website, all you'll have to do is create a CMS page called "home" (original right?) and add {{block type="core/template" template="page/html/home.phtml"}} to its content. Then go to System > Configuration >General > Web > Default Page and there, select your freshly created home page, hit ...


11

Create local.xml under app/design/frontend/your package/your template/layout/ And Put the code <?xml version="1.0"?> <layout version="0.1.0"> <cms_index_index> <reference name="root"> <block type="core/template" name="my.vblock" before="content" template="page/home/myblock.phtml" after="breadcrumbs" /> ...


11

Since this was EE, I was able to utilize Magento support but I also worked things out on my own to help focus the issue and get a solution as fast as possible. The code changes were provided by Magento so applying them to the actual app/code/core files is fine though you could always duplicate the files in your /app/code/local and apply the changes there. ...


11

From templates you can simply call static block by <?php echo $block->getLayout()->createBlock('Magento\Cms\Block\Block')->setBlockId('block_identifier')->toHtml();?> Links in footer generate by layout in module Magento_Theme <referenceContainer name="footer-container"> <container name="footer" as="footer" label="Page ...


11

You almost had it. Here's the code you need to use: {{block class="Magento\Newsletter\Block\Subscribe" name="static.newsletter" template="Magento_Newsletter::subscribe.phtml"}}


11

Add store direct_url instead of store_url <a href="{{store direct_url='produkte/insektenschutz/fenster/spannrahmen.html'}}"> spannrahmen.html will show after this.


10

I think proper way is we need to create Custom module because you all know that Magento Boogieman will get you! if change the core :) You will need to following files: app/etc/modules/Bhupendra_Cms.xml <?xml version="1.0"?> <config> <modules> <Bhupendra_Cms> <active>true</active> <...


10

To reference a container you need to use referenceContainer as opposite to referenceBlock to reference a block. The container tag is used to create a container as the block tag is used to create a block. In your case, the right code would be: <referenceContainer name="sidebar.additional"> <block class="Magento\Cms\Block\Block" name="test"> ...


9

Right, so I (and you guys) were very close. In the current CMS page in Design > Custom design > Custom Layout Update XML field I had to put <block type="cms/block" name="home_center-image" before="-"> <action method="setBlockId"><block_id>home_center-image</block_id></action> </block> and before I tried just <...


9

I don't think there is a right answer for this. The path you choose depends on your needs. I usually avoid using widgets. Specially when working with "not so technical" clients. The widget system in Magento is not that easy to use or to explain to someone else. I usually put everything in phtml files so the chance of something getting screwed up is smaller. ...


9

You can remove this block completely via layout with remove="true": app/design/frontend/TemplateMonster/Spiceli/Magento_Newsletter/layout/default.xml <?xml version="1.0"?> <page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd"> <body> ...


Only top voted, non community-wiki answers of a minimum length are eligible