Thursday, 21 August 2014
Static blocks are very useful tools in Magento. We can effectively use them in different situations. They provide us enough power on content management. However I felt it lacks with something. It can show its content only in boring text format. If we are planning to use multiple static blocks in a page, then we will definitely seek for adding css and js for static block contents. However if we are planning to do it in the most effective way, we can't achieve this functionality in one step. For this small (some time big) headache, I decided to make an end. It results in a tiny magento extension Rkt_JsCssforSb.
What it does
This extension functionality is simple. For every static block, you can see a section for put javascript and css. You need to put css and js in those text areas. Rest will do by the extension. You don't need to put script and style html tag enclosures inside text area. This job will effectively carry out by extension. Css that added for static blocks will get append to head section and scripts will go to bottom section in body part.
In deep
Static block are least considered section in magento code wise !. I am telling this because, during the development of this extension, I have found out that, there are no static block specific events available. However cms pages has lot of events available. Also model of static block is somewhat "weak" when compare with other entity models! For example, there is no event prefix available for static blocks. This made me in serious trouble and as a result, I have done a model rewrite during the development of the extension. I know its bad. But I forced to do it. Along with this, I am observing to three events in order to make the work done.
But I personally believe this extension is highly useful. Since it makes static block somewhat "dynamic". We can set css and make static block content look nice and by applying some js , we can make those contents dynamic etc.
I am waiting for your feedbacks about this extension. Currently the extension is available on GITHUB and soon it will available in Magento connect. Hope you will use it.
Useful Links
- http://stackoverflow.com/questions/17832914/how-do-i-extend-cms-block-on-save-event-of-magento
- http://magento.stackexchange.com/questions/32324/how-to-check-whether-a-block-exist-based-on-its-type
Subscribe to:
Post Comments (Atom)
Stack Exchange
Recently Answered
Popular Posts
-
In this post, I would like to show you how can we get product option values. For this, let us start with creating a sample product that h...
-
Static blocks are very useful tools in Magento. We can effectively use them in different situations. They provide us enough power on content...
-
Some times, it would be great if we can add a collapse/expand functionality in CMS Pages in Magento. A perfect example would be a read more ...
-
By default every Magento product list page has to modes of view. They are List and Grid . We can set default mode through admin. For this ...
-
Here in this tutorial, I would like to share you how can we set page size for a particular category. The Page Size is actually a property...
-
The main reason, in fact the inspiration behind this blog is this THREAD . In this thread, the user want to add layout that render by...
-
Introduction ---------------------- When I started to do Module Development in Magento, a lot of time I got an error like this Fat...
Blog Archive
Categories
Powered by Blogger.
De mogelijkheden zijn ongekend en niet onopgemerkt gebleven. Op dit moment zijn er wereldwijd al meer dan 100.000 Magento webshops online en dit aantal groeit iedere dag. Met elkaar genereren deze Magento webshops al meer dan 30 miljard euro! Deze explosieve groei kenmerkt de kracht van Magento. Here are Nieuwe Magento shop,Magento onderhoud,magento update and magento webshop.
ReplyDeleteHi! I have 1.5 years experience. I search in Google so Many Websites & Blog but you’re blog and post really is too good its title, description, images your content style is really good and I feel glad when post read Magento CMS Development
ReplyDeleteBy using it, your products can be seen by a large market without your employees or you spending money to do any marketing. One of the major advantages of online shopping is that you can reach out to millions of people. Get more interesting details about progressive web app check this site.
ReplyDelete