CMS Block in all pages

I need to put a couple of small images and text that runs horizontally from left to right towards the bottom of ALL pages of the site.
Position-14 looks like a suitable CMS block.
Except position-14 only shows in the homepage.

How can I show position-14 static CMS block in ALL pages?


1 answer

Profile photo of Saguaros 0.00 $tone June 12, 2014

Basically, if you want to add Static or non-static blocks to all pages, you just need to add them directly to template files:

PHP Code:

<?php echo $this->getLayout()
setBlockId('your_block_id')->toHtml(); ?>

With the position-14 block in this case, depending on the layout you’re using ‘1column, 2columns-left,…’, you will edit the corresponding php file. For example, suppose that you use 2columns-left layout, open the file: \app\design\frontend\default\jm_megamalltemplate\ page\2columns-left.phtml

Underneath the block code for the <!-- MAIN CONTAINER -->, add this code snippet:

PHP Code:

<div id="jm-mass-bottom" class="jm-mass-bottom wrap clearfix">
    <div class="main col3-set">
        <?php echo $this->getLayout()->createBlock('cms/block')->setBlockId('position-14')->toHtml(); ?>     

Once done, flush all caches.


Please login or Register to Submit Answer

Written By