Book Image

Mastering Magento Theme Design

By : Andrea Sacca
Book Image

Mastering Magento Theme Design

By: Andrea Sacca

Overview of this book

Table of Contents (18 chapters)
Mastering Magento Theme Design
Credits
About the Author
About the Reviewers
www.PacktPub.com
Preface
Index

Creating a widget with options


If you select one of the existing widgets, you can see that some of them come with configurations options. The widget we created is very basic and now we are going to see how to add some simple options that will allow the store manager to customize the frontend block. The plan is to allow the user to choose which services to display on the frontend.

The options we are going to insert are as follows:

  • One checkbox option that shows or hides the shares count bubble

  • One input textbox that allows you to insert a block title

Adding options to our widget.xml

To add some options to our widget, you need to edit the widget.xml file by adding the following parameters:

  • required: This is used to define if an option is required or not

  • visible: This is used to set the visibility of an option

  • label: This is used to set the option title

  • type: This is used to set the type of the option (checkbox, text, and so on)

To start adding options to the widget, return to the widget.xml file...