Widget creation
Widgets are self-contained blocks of functionality, based on PHP, HTML, Twig and JavaScript. They are used to extend Jadu Central and integrate with 3rd party services.
Creating a widget
Creating widgets using the Widget Manager interface
- Go to Utilities then Widget Manager.
- Press the New Widget button.
Widget fields
| Title | Description | Required |
|---|---|---|
| Title | Name of the widget. This is shown in the Homepages designer. | Yes |
| Description | Description of the widget. Limited to 200 characters. Can contain new lines. | Yes |
| Default width | This is how wide the widget will be when initially added to a row in the Homepage Designer. | Yes |
| Machine name | A unique identifier for this widget in the application, database, and filesystem. Cannot be edited. | |
| Requires Categories | Tick box to show the Assign categories button in the widget settings tab. | No |
| Signed in users only | [Yes / No] Whether the widget is only available to front end users who have authenticated with the site. | Yes |
| Scope | Where the widget will be available to be used [All sites / This site only / Galaxies only / Enterprise sites only ] | Yes |
| Visible | [Yes / No ] Whether the widget is visible within this site's Homepage Designer list of widgets. | Yes |
| Update method | [Browse for widget from your local drive / Manually enter widget code ] What to include in a widget zip archive if Browse for widget from your local drive is chosen | Yes |
| Front-end | The content of public.php. Used as the widget preview on Photon sites. | Yes |
| Front-end JavaScript | The content of public.js | No |
| Settings | The content of secure.php | No |
| Settings JavaScript | The content of secure.js | No |
What to include in a widget zip archive
| File | Purpose | Required |
|---|---|---|
| public.php | The file that contains the HTML or PHP you want your website visitors to see | Yes |
| public.js | The file that contains any JavaScript required for the presentation of the widget on the website. The JavaScript in this file is combined and published dynamically in a global JavaScript file called widget.js. Dependent on your site's implementation, widget.js may be included only on homepages or on all pages of the site. This means that it must be robust, and handle cases where there are zero, one or multiple instances of the widget on a page. | Optional |
| secure.php | The file that contains the HTML or PHP used to specify any settings when using the homepages designer. | Optional |
| secure.js | The file that contains the JavaScript used in secure.php. | Optional |