Magento 1.8 – What is a Widget in Magento

magento-1.8

I need to call right banner here bello my code is

<p><span style="margin-bottom: 5px; display: inline-block;"><img class="img-responsive" 

> title="" src="{{media url='banner/right-banner.png'}}" alt=""
> width="100%" /></span> <span style="margin-bottom: 5px; display:
> inline-block;"><img class="img-responsive" title="" src="{{media
> url='banner/right-banner.png'}}" alt="" width="100%" /></span> <span
> style="margin-bottom: 5px; display: inline-block;"><img
> class="img-responsive" title="" src="{{media
> url='banner/right-banner.png'}}" alt="" width="100%" /></span></p>

I created static block And called this on home cms…

I want to know that how can I call this as a widget …
How can we create widget and what is widget, Is it different then static block..

Best Answer

A widget is somehow similar to a static block but not really :).
As a concept, a widget is a unique key (widget type) that maps to some code, and a set of parameters used by that code.
A static block is actually some text that can contain other elements (like widgets).
The difference between them from Magento's point of view is that you can place different widgets in different sections of different pages using the backend UI. The static blocks can only be placed in fewer page types and sections.
But you can use the same concepts, combined. Static blocks can contain widgets and the other way around.
In your specific case, you can create your banner as a static block , then use is as a widget.
Go to CMS->Widgets, create a new widget instance that uses the cms block and place it in the available pages.
It's kind of hard to explain how it works in a few words. Just play around with the UI from the CMS->Widgets section in the admin.