• Home
  • Magento
  • Contact
  • 33 BCS seat plan | Download pdf for 3...
    Download pdf for 33rd BCS Exam Seat plan 2012

    Download 33rd BCS Preliminary Exam 2012 Seat Plan in Bangladesh. BPSC (Bangladesh Public Service Commission) published seat plan for the 33 BCS preliminary (MCQ Type) Examina [...]

    Read more
  • How to apply for College Admission 20...

    Procedure of applying for College Admission 2012 – 2013 session by mobile SMS. If you passed SSC (Secondary School Certificate) exam 2012, you can easily apply for admi [...]

    Read more
  • Alim Result 2012 | HSC / Equivalent R...
    Alim Result 2012 | HSC / Equivalent Result 2012 Bangladesh

    HSC/HSC Vocational/Alim (Madrasa Board)/Equivalent examination result 2012 of all educational board in Bangladesh will be published soon. 10 education boards ( Dhaka, Chittag [...]

    Read more
  • National University Result | Get Bang...
    National-University- Result-Bangladesh(nu)

    If you are a student of National University – Bangladesh, you can get your result form official website of National University. The National University result authority [...]

    Read more
  • Bangladesh Primary School Teacher Exa...

    The result of Primary School Teacher Exam 2012 in Bangladesh have published. A lot of candidate have selected in this year. Total 44,609 candidates passed this exam including [...]

    Read more
  • Primary School Teacher Exam Result 20...

    The result of Primary School Teacher (Non govt Assistant) Exam Result 2010 in Bangladesh published today. For This year total 42,611 candidates have selected. Congratulation [...]

    Read more
  • How to place a space between currency...
    How to place a space between currency symbol and amount in magento

    If you involve with Magento development you may be know, there are no space in between currency symbol and price amount in magento default system. Recently i am working for a [...]

    Read more
  • Fixtures for Asia cup 2012 | Schedule...
    Fixtures for Asia cup 2012 | Schedule / Time table and Venue

    Asia Cup 2012 will begin on March 11, 2012, Sunday. Bangladesh will host this tournament. It is an international tournament to be organized by Bangladesh. All match of Asia C [...]

    Read more
  • Players list for all Teams of IPL 5 |...
    Players list for all Teams of IPL 5 | Indian Premier League 2012

    The IPL – 2012 will be the fifth (5th) Indian Premier League competition which involving 76 matches among 9 teams. It will commence and finish in Chennai, from 4 April 2012 t [...]

    Read more
  • How to submit 33rd BCS application fo...
    Download pdf for 33rd BCS Exam Seat plan 2012

    How can you submit 33rd BCS application form by online / internet This year you will be able to submit your application forms of the 33rd Bangladesh Civil Service (BCS) test [...]

    Read more
KEEP IN TOUCH

Creating and Showing a static block in Magento Frontend

Dec18,2011 2 Comments Written by Admin

Static block is the great way to show up different types of data in your Magento webstore. This is the easiest way to display something on the frontend of your magento website.  The content of the blocks are created and modified from Magento Admin panel which can be placed on one or multiple pages. To create a static block you can follow some simple steps which are given bellow.

Creating a Static Block:

A. Go to the Magento Admin panel and then select the  CMS -> Static Blocks.

B. Then Click on the “Add New Block” button from the right top .

C. Now fillup the following fields:

  1. Block Title: Give the Name of the static block here. This will not show on the frontend.
  2. Identifier: Give the id of this block. It used as reference of this block, when adding to a template file or CMS page.
  3. Status: Its define visibility of this static block on the frontend.
  4. Content: Content of static block can be plain text, HTML code and Javascript. PHP code can’t use in this area.

D. After fillup all fields then click on “Save Block” button from the right top .

Showing a Static Block in Frontend:

A static block can be added to display on the frontend by some different ways which are discribed bellow:

1. Adding a static block to a CMS page From the Magento admin:

Go to CMS > Pages and click on a pre-existing page or create a new page where you want to show your static block.

Now use the following code in the Content field of the CMS page:

  1. {{block type="cms/block" block_id="your_block_identifier" template="cms/content.phtml"}}
{{block type="cms/block" block_id="your_block_identifier" template="cms/content.phtml"}}

2. Adding a static block by using template phtml file:

Open your phtml file where you want to add the static block.

For Example: /app/design/frontend/your-instance-name/your_theme/template/callouts/right_col.phtml

Then you can use the following code in your phtml file to show the content of your ststic block:

  1. <?php echo $this->getLayout()->createBlock('cms/block')->setBlockId('your_block_identifier')->toHtml() ?>
<?php echo $this->getLayout()->createBlock('cms/block')->setBlockId('your_block_identifier')->toHtml() ?>

3. Adding a static block by using XML layout file:

Use the following code to show the content of static block by using Layout XML file:

  1. <reference name="content/left/right">
  2.    <block type="cms/block" name="your_block_name" before="-">
  3.     <action ethod="setBlockId"><block_id>your_block_identifier</block_id></action>
  4.   </block>
  5. </reference>
<reference name="content/left/right">
   <block type="cms/block" name="your_block_name" before="-">
	<action ethod="setBlockId"><block_id>your_block_identifier</block_id></action>
  </block>
</reference>

Note: You can use the above code to show the block content in specific page by using “ Layout Update XML ” field of CMS page.

To do this go: CMS -> pages from your magento backend. Then click on on that page where you want to show the static block.

Then click on Design tab from left panel like:

Now Past the above code in Layout Update XML  field.
here i wrote <reference name=”content/left/right”> in code. You must use only one like- content / left or right as your reference name.

OTHER TOPICS:

  • Including javaScript file or jQuery library in Magento

  • How to Remove Callout section from left / right side of Magento

  • Create Accordion Menu for Magento Layered Navigation

  • Change default sort order direction (ASC to DESC) for product listing in Magento

  • How to show products on Magento Homepage from specific Category

Posted in Magento - Tagged Magento Static Block
SHARE THIS Twitter Facebook Delicious StumbleUpon E-mail

2 Comments

  1. Jonson's Gravatar Jonson
    January 12, 2012 at 4:07 PM | Permalink

    I really treasure your work , Great post.

    Reply
  2. Antone's Gravatar Antone
    February 2, 2012 at 3:18 PM | Permalink

    Awesome job over again! I am really happy after showing a static block in my homepage. thanks for share it.

    Reply

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

*

*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code lang=""> <del datetime=""> <em> <i> <q cite=""> <strike> <strong> <pre lang="" extra="">

Latest Technology News

Find us on Facebook

Recent Posts

33 BCS seat plan | Download pdf for 33rd BCS Exam Seat plan

33 BCS seat plan | Download pdf for 33rd BCS Exam Seat plan

Download 33rd BCS Preliminary Exam 2012 Seat Plan [...]

No thumbnail available

How to apply for College Admission 2012 by SMS in Bangladesh

Procedure of applying for College Admission 2012 -[...]

Alim Result 2012 | HSC / Equivalent Result 2012 Bangladesh

Alim Result 2012 | HSC / Equivalent Result 2012 Bangladesh

HSC/HSC Vocational/Alim (Madrasa Board)/Equivalent[...]

National University Result | Get Bangladesh NU Result

National University Result | Get Bangladesh NU Result

If you are a student of National University - Bang[...]

No thumbnail available

Bangladesh Primary School Teacher Exam Result 2012

The result of Primary School Teacher Exam 2012 in [...]

No thumbnail available

Primary School Teacher Exam Result 2010 Bangladesh

The result of Primary School Teacher (Non govt Ass[...]

How to place a space between currency symbol and amount in magento

How to place a space between currency symbol and amount in magento

If you involve with Magento development you may be[...]

Fixtures for Asia cup 2012 | Schedule / Time table and Venue

Fixtures for Asia cup 2012 | Schedule / Time table and Venue

Asia Cup 2012 will begin on March 11, 2012, Sunday[...]

Recent Comments

  • Mahabub on How to apply for College Admission 2012 by SMS in Bangladesh
  • APARESH on HSC exam routine/schedule 2012 Bangladesh pdf/word download
  • Admin on Alim Result 2012 | HSC / Equivalent Result 2012 Bangladesh
  • Asif on Alim Result 2012 | HSC / Equivalent Result 2012 Bangladesh
  • Admin on SSC, SSC(VOC), Dakhil(Madrasha) Exam result 2012 | Bangladesh

Categories

  • Bangladesh Xpress
  • Magento
  • Sports
  • Tips and Tricks

EvoLve theme by Theme4Press  •  Powered by WordPress XpressBangla

Copyright © 2012 XpressBangla. All rights reserved.
  • Delicious
  • Static block is the great way to show up different types of data in your Magento webstore. This is the easiest way to display