Magento - Adding Static Block content to a Page
Add Magento static blocks to your page easily! Simply copy this line of code below where you want the static block to appear and change the 'identifier' to the identifier of the static block you created. That's it!
<?php echo $this->getLayout()->createBlock('cms/block')->setBlockId('identifier')->toHtml() ?>
I use Free CMS module that is...
I use Free CMS module that is very useful. You can see the demo here: http://demo.hello-magento.com/freecms/furniture.html
what page? where in the page?...
what page?
where in the page?
Hey Blade, basically to any...
Hey Blade, basically to any page you want. You just need to have an identifier that exists for a specified block. So if you where to create a static block by going to CMS -> Static Blocks and click on Add a new block, give it a title, identifier, set the status to enabled and add some content. Hit save. Now to add that static block to a page, locate the page you want to add this blocks content to and add the line of code in this post. Don't forget to change the identifier to the identifier you specified when creating the static block. That's it!
Tiny post, GREAT solution!! ...
Tiny post, GREAT solution!! Thank you Richard!
Thanks Fernando!...
Thanks Fernando!
Is there a reason I shouldn't...
Is there a reason I shouldn't just use this method?
Brad, Sure there is... The...
Brad, Sure there is... The method that you specified is used to add the content inside a CMS page. The method in the post is used to add content to a .phtml page. Hope this helps.
This was really helpful!...
This was really helpful! Thanks for posting it. (You probably already know how hard it is to find concise Magento solutions like this!)
Thanks!...
Thanks!
This is EXACTLY what I was...
This is EXACTLY what I was looking for! Great solution. Thank You Richard!
Michael, I'm happy you found...
Michael, I'm happy you found this useful!
Hi Richard thanks very much...
Hi Richard thanks very much for this. It is a clear and straight to the point instruction (unlike many other magento guides out there)
Could you please tell me what I would need to do to add something just above the footer of all pages (I would like to have a paypal verified image)
I am new to magento and still learning coding, it is quite confusing.
Thanks again
Tom, you can look at this...
Tom, you can look at this post on creating a static block in Magento, http://www.richardcastera.com/2009/05/18/magento-adding-static-block-con...
Hi Richard, does this work if...
Hi Richard,
does this work if it's not a static cms page would it work on a product category page and how do you access it?
Thanks, Kelli
Hey Kelli, Sure you can add a...
Hey Kelli,
Sure you can add a static block to a Product Category Page! Your best bet is to add it VIA the layout file.
Dear sir, I've been working...
Dear sir,
I've been working on M for about a week and am still trying to piece together how everything works. Thank you so much for your assistance and sharing.
Thanks!...
Thanks!
Hi Richard, great post!! got...
Hi Richard, great post!! got a bit of a headache tho
how can you make CMS block appear above a category page layout?
For example: if you have 2columns-left set as your category page layout how can i make a CMS block appear above this layout? and also be able to add a different block to each category page via the admin panel?
here is my problem http://gogglefirm.com/snow.html
as you can see i have the static block in the page but i want it to clear the left col and main col.
any ideas
Cheers
Craig
Craig, you can follow this...
Craig, you can follow this article to achieve what your looking for: http://www.richardcastera.com/2009/05/20/magento-re-ordering-block-items/
Hi. Can I have one question?...
Hi. Can I have one question? There are possibility to use static block in product description? When I put
to them I see only this text, no block content
I found solution it is...
I found solution it is necessary only add this two lines in the proper place into app/code/core/Mage/Catalog/Helper/Output.php to method productAttribute()
Good solution. it is very...
Good solution.
it is very helpful for us
thanks for the help richard.
Hi, I have searched for...
Hi, I have searched for solutions everywhere, but it was too hard or time consuming. And i found this magento extension to show categories where you want as block.
Here is a link: http://www.storefrontconsulting.com/software/featured-categories-magento...
Thanks for this Richard!...
Thanks for this Richard! Saved my time!
hi richard, can u explain me...
hi richard,
can u explain me how to move menu from top to left or right
and how to pages in menu?
Thanks a lot, mate. Saved me...
Thanks a lot, mate.
Saved me a lot of trouble
Thanks Richard, I can't count...
Thanks Richard, I can't count the number of attempts I have made using various code from more than I can count sites/tutorials and yours is the first that has worked . I finally have additional content added to my site
Hi richard, thanks for the...
Hi richard, thanks for the help and it is a good solutions.
i have static footer blocks...
i have static footer blocks with relevant SEO text for certain pages. It was working fine and all of a sudden all the static footer blocks disappeared. I cant seem to get it back. This is the code U used:
I added this code in the layout update XML section in the design tab of the homepage.
Any help is appreciated
Hello i am new in magento...
Hello
i am new in magento and learn all things, but i have question
1) i create one "Education price" name page
2) i Create a Static Block Name "Prices" in that static block i write some content and also "click here" link
3) i want to show the "Education price" in click of "click here" link
so how can i do that plz help me
Thank YOu
Amrish
Post new comment