For effectively developing widgets developers need to download and install Developer Version of the framework. Developer version is a simplified version of MyWeb's core.
Developers will find all necessary API - s that are required for creating fully functional widgets. Developer version consists of following parts:
Please read documentation carefully before beginning widget development.
To begin widget developments developers need to satisfy minimal system requirements. Read details below:
First of all you need to download developer version of MyWeb: mywebdev.zip. Installation is simple and requires zero configuration. You just need to extract downloaded zip file into your local webserver's root directory.
After installation you will see file structure shown on the picture below:
Thats it, installation and configuration are completed. Now you can begin development of a widget. First of all open “index.html” file(look at the selected file on the picture above). This is entry point where developers can load and test widgets on demand, without any further configuration. Lets look of the file structure:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> <head> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> <link rel="stylesheet" type="text/css" href="udw/assets/styles/style.css"/> <script type="text/javascript" src="udw/js/udwdev.js"></script> </head> <body> <!-- target container where widget will be inserted --> <div id="w1"></div> <script type="text/javascript"> loadWidget( { widget: 'googlesearch', target: 'w1', style: 'white' } ); </script> </body> </html>
This file contains all required script and style includes that are required for loading and running widgets. Only part worth of mentioning is “loadWidget()” JavaScript function that is invoked for loading actual widgets. It requires one parameter with structure shown below:
| Key name | Description | Required |
|---|---|---|
| widget | Name of the widget to be loaded | Yes |
| target | ID of the target HTML element where the loaded widget will be inserted | Yes |
| style | Initial style of the widget. You can choose from white, blue, red, yellow or green | No |
For example for loading “helloworld” widget you need to write following code:
loadWidget( { widget: 'helloworld', target: 'w1', style: 'white' } );
For further information and details on widget development please visit following documents: