Ina Code Blog

bunch of code in one place
« Magento: Change image background color
Magento speed problem »


Jan
27

Magento: Add static block

Posted by admin in Magento

Go to Magento admin uder CMS -> Static Blocks and Add New Block. Insert Block cialis generic brand Title, Identifier (for example: my-new-block), set Status to Enabled, insert block Content and Save Block.

If you want to put your static block in left column open file /app/design/frontend/your_theme/your_theme/template/callouts/left_col.phtml and insert code below where you want the static block to apear:

<?php Buy Viagra Online Without Prescription echo $this->getLayout()->createBlock(’cms/block’)->setBlockId(’my-new-block’)->toHtml() ?>

You can put this code wherever you want the block to apear, for exapmle right_col.phtml, 3columns.phtml, … Sky is your limit …

[Slashdot] [Digg] [Reddit] [del.icio.us] [Facebook] [Technorati] [Google] [StumbleUpon]

6 Responses to “Magento: Add static block”

  1. Added by Riki Risnandar on Feb at 5

    thx for tips ! very usefull when customizing magento :)

  2. Added by danny on May at 15

    Nice! how would i plce this on one page only? for e.g i have the sub category y under the category x, how could i place a block on the category page y only?

  3. Added by Sam on May at 21

    Excellent, just what I needed - and waaaay simpler than the version I’ve been working on!

  4. Added by admin on May at 25

    To place a block to a certain category or subcategory just select the category in Catalog -> Manage Categories and open tab Custom Design. In the CMS Block line select the block you want to show from the drop down block list.

  5. Added by Arjun on Sep at 9

    Thanks for - this top tip!

  6. Added by Private Servers on Feb at 12

    Habbo Retros…

    Habbo Retros are slowly attracting more users with each passing day, most people prefer to play Habbo Retros with pets according to a recent google study, further evidence also supports that Habbo Retros have lead to an annual decrease in revenue for s…

Leave a Reply

Comment