2

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..

2 Answers 2

4

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.

3
  • I m very thankful for this answer....and what is the good way of creating module in magento....I used your module creator bt i was not easy to understand...can i get any good document...of module creator....thanks Oct 16, 2014 at 10:46
  • @DeepakKumar. Indeed that can be overwhelming if you are not familiarized with Magento. My advice is to get to know first how magento works. at least the basics. Then, in order to understand how the module creator works, read this: github.com/tzyganu/UMC1.9/wiki
    – Marius
    Oct 16, 2014 at 11:27
  • thnaks....for help Oct 16, 2014 at 12:01
0

As far as I have understood:

  • widgets are dynamic vs. blocs are static
  • more portable (can be used practically in any section of a site)
  • widgets are more like tools (e.g. forms, grids), and blocks are more like ready products (blocks of text)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.