WS.WebTV: Adding a Widget Zone (Advanced Customization).
support, ws.webtv, advanced, customization, create, widget, zone
A Widget is a block of HTML code that is inserted into a zone of the WebTV page. By default, there is one Widget zone defined (for the sidebar); however, you can add additional zones if required.
We will explain how to add a Widget zone with an example...
For the example we will add a new zone we will identify as "my_zone".
1. Open/Edit the _theme.ini file
The theme file is located in public/frontend/default/_theme.ini
Please note that it is a JSON, plain text, UTF-8, file.
You can use any plain text editor like Notepad, Notepad2, Notepad++, Dreamweaver, etc. to edit it.
...now look for the following section:
"widget_zones" : {
"sidebar" : { "file" : "widget_panel.tpl", "file_mobile" : "widget_panel.tpl" }
},
2. Add a new entry for your new zone (and save...)
"widget_zones" : {
"sidebar" : { "file" : "widget_panel.tpl", "file_mobile" : "widget_panel.tpl" },
"my_zone":{ "file" : "widget_panel.tpl", "file_mobile" : "widget_panel.tpl" }
},
"my_zone" is the zone ID: It must not contain any space or special characters.
"file": Is the HTML template used for wrapping the Widget.
"file_mobile": If you plan to use the new zone in the Mobile Interface, then provide the HTML template used for wrapping the Widget on that interface.
Note: Since the JSON format is very strict, we recommend you to validate the file after performing any modification to it. In order to do this you can use an online validation tool like these.
3. Publish the modified "_theme.ini" file into the server
After publishing the file, go to Configuration > Widgets: The new zone should be listed in the zones dropdown.
4. Include the new zone label into the desired template
For example, if you want to add the zone to the Text Channel template (without the sidebar) edit the file page.tpl, find the place where you want the new zone's widgets to be inserted and enter the corresponding label; in the case of this example it would be:
{k.html.widget_zone_my_zone}
Advice: Always keep track of any modification you make to the WebTV so you can re-apply it after updates or reinstallations.