Customizing theme gadgets
Gadgets are elements used to display content on Wild Apricot site pages. Gadgets can be used to display page components such as login boxes, menus, forum updates, and membership registration forms, among many others. The appearance of gadgets will vary depending on the website theme, as will the gadget style options.
Gadgets, like controls and master layouts, are rendered using a combination of HTML and StringTemplate, a Java template engine.
Once you enable theme overrides and downloaded the theme files, you'll find a Gadgets folder, containing files that control the behavior of the gadgets used in the theme.
Individual gadget configuration files
For each system gadget, there is a separate subfolder under Gadgets containing several files, including the following:
Gadget configuration file.
Gadget template file. This file provides the actual code for the gadget. You can modify this file to change how the gadget functions.
MainConfig.cfg is the main configuration file for your gadget. In it, you can set the following parameters:
Full name of the gadget.
Short name of the gadget.
Name of the module providing the data to the gadget.
Description of the gadget.
Icon to be displayed in gadget selection screen.
Small icon to be displayed in gadget selection screen.
Type of gadget.
Class name to be added to gadget outer HTML.
Creating a new gadget
To create a new gadget, follow these steps:
- Create a folder under the Gadgets folder.
- Create MainConfig.cfg and GadgetTemplate.tpl files.
- If you want, you can add gadget style settings to appear on the Colors & styles screen. For more information, see Customizing Colors and Styles options for themes.
Gadgets and modules
Gadgets can use modules. Modules provide additional data to be used by the gadget. For example, if you're creating photo album gadget, you'll need a collection of links to photos and thumbnails. If you're creating a login form gadget, you'll need the form URL to send login data to.
See also Adding parameters to gadgets to learn how to add and use parameters in your gadget.