Skip to main content

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

  1. Go to Utilities then Widget Manager.
  2. Press the New Widget button.

Widget fields

TitleDescriptionRequired
TitleName of the widget. This is shown in the Homepages designer.Yes
DescriptionDescription of the widget. Limited to 200 characters. Can contain new lines.Yes
Default widthThis is how wide the widget will be when initially added to a row in the Homepage Designer.Yes
Machine nameA unique identifier for this widget in the application, database, and filesystem. Cannot be edited.
Requires CategoriesTick 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
ScopeWhere 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 chosenYes
Front-endThe content of public.php. Used as the widget preview on Photon sites.Yes
Front-end JavaScriptThe content of public.jsNo
SettingsThe content of secure.phpNo
Settings JavaScriptThe content of secure.jsNo

What to include in a widget zip archive

FilePurposeRequired
public.phpThe file that contains the HTML or PHP you want your website visitors to seeYes
public.jsThe 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.phpThe file that contains the HTML or PHP used to specify any settings when using the homepages designer.Optional
secure.jsThe file that contains the JavaScript used in secure.php.Optional

Creating and registering widgets as a developer

Developer documentation about Widgets.