Search code examples
magentolayoutcontent-management-systemstatic-block

Loading the content of a static block from inside a magento CMS layout?


How would one load the content of a Magento static block inside a CMS layout?

My goal is to load the static block {{block type="cms/block" block_id="menu_about"}} inside the layout, cannot find on how to do this who can help me? thank you!

    <!DOCTYPE html>
<html lang="en">

<head>
    <?php echo $this->getChildHtml('head') ?>
</head>

<body<?php echo $this->getBodyClass() ? ' class="' . $this->getBodyClass() . '"' : '' ?>>

<div class="wrapper">

    STATIC LEFT CMS

    <div class="wrapper_header">
        <?php echo $this->getChildHtml('global_messages') ?>
        <?php echo $this->getChildHtml('header') ?>
    </div>

    <div class="container">

        <div class="menu_left col-lg-4 col-md-4">
            {{block type="cms/block" block_id="menu_about"}}
        </div>

        <div class="col-lg-8 col-md-8">
            <?php echo $this->getChildHtml('content') ?>
        </div>
    </div>

</div>
</body>
</html>

Solution

  • <div class="menu_left col-lg-4 col-md-4">
        <?php echo $this->getLayout()->createBlock('cms/block')->setBlockId('menu_about')->toHtml(); ?> 
    </div>