The Magento Community Edition Version 1.4 facilitates the use of custom frontend extensions by introducing a new concept of customizable widgets, which can provide more control over the frontend behavior and visual block placement to store owners.
Here I am assuming that magento e-commerce software is already installed on your site. If magento e-commerce software is not installed on site then please go to http://www.magentocommerce.com and install it on your site. Follow the the installation guide: http://www.magentocommerce.com/wiki/installation_and_configuration/magento_installation_guide for installation of magento e-commerce software.
We will write a customise widget which will display Polls which are created on the requestio.com. After creating this plugin, user will be able to see the polls you created on requestion.com and they also will be able to vote on those polls.
Add widget instances in the admin panel:
For creating customize widget in magento we have to do 2 steps.
- Add Statics blocks in admin panel CMS > Static Blocks
- Then use these static blocks on pages CMS > pages by inserting widgets on these pages.
Add Static Block – CMS > Static Blocks
By using static blocks you are able to create content for category pages, allowing you to showcase items and promotions instead of just displaying the grid list of products.
To create a static block go to CMS > Static Blocks, then select Add New Block.
In this case we are going to create a block for showing the polls from requestio.com.
We enter the Block title, for internal use, and the identifier, which will create the URL for this page.
We then select the store we want to use the Block on, in this case all stores, and set the Block to enabled. Once that is done we enter our content in an HTML Format and select Save Block.
We have used following html code in content of our static block –
<div id="pollhere">poll will generate here</div>
<script>var pollID=77;</script>
<script src="http://app.requestio.com/poll_js/riop.js"></script>
And we have given the Block title as, “Custom poll widget”.
Now move to second step :
Add widget instances in the admin panel using content editor
Let’s go to CMS > Pages in the admin panel and add a few widget instances on the homepage (select homepage from the list of CMS pages, click the “Content” tab on the left).
“Add Widget” button in WYSIWYG mode:
Widget selection and configuration popup:
Widget in the CMS page content in the WYSIWYG and plain text mode:
Check over the frontend
The requestio poll widget(Who will will the T-20 world cup 2010) is shown in the right hand side of the page in the above picture.
If user selects any country and click on vote button then following output will be displayed in the “Requestio poll widget”.






