Widget Anatomy

A widget has HTML, CSS, client script, server script, options. Server script runs on the instance, returns data. Client script uses AngularJS to bind. Keep the server script lean — the bigger it is, the slower page load.

Data Calls: server.data vs GlideAjax

For page-load data, populate server.data in the server script. For user-triggered calls, use GlideAjax. Don’t try to load everything on render.

Reuse Widgets

If a widget is called from 3+ pages, it’s reuseable. Parameterize via options, document the options in the widget description, and resist the urge to copy-paste. One widget, multiple placements.

Responsive CSS Without Pain

Bootstrap 3 is the portal’s underlying framework. Use its grid and utilities. Custom CSS goes in the widget, not instance-wide sheets. Theme variables via the branding editor.

Upgrade Safety

Out-of-box widgets get patched. Custom widgets don’t. When you override an OOB widget, document why and diff against the latest OOB version after each release.

Share