Skip to content

widgets.xml

widgets.xml is the legacy XML format for desktop widgets.

New package documentation should prefer current panel and backend integration patterns. Keep widgets.xml support in mind when maintaining older packages that still provide desktop widgets.

Basic Structure

xml
<widgets>
    <widget>
        <title>Example Widget</title>

        <attributes
            height="1"
            width="2"
            icon="fa fa-info"
            refresh="1"
        />

        <content type="html">
            <![CDATA[
                <strong>Widget content</strong>
            ]]>
        </content>
    </widget>
</widgets>

External Widget Files

A widget can also be declared in a separate XML file.

xml
<widgets>
    <widget src="OPT_DIR/vendor/package/widgets/example.xml"/>
</widgets>

The referenced file contains one <widget> definition.

Content Types

Legacy widgets can provide inline HTML or load content through an Ajax function.

xml
<content type="html">
    <![CDATA[Widget content]]>
</content>
xml
<content type="ajax" func="ajax_system_phpinfo"></content>

Practical Checklist

Before maintaining widgets.xml:

  • Check whether the package can use a current backend panel instead.
  • Keep widget dimensions small and useful.
  • Use package-owned widget files when definitions become larger.
  • Avoid adding new Ajax callbacks without server-side permission checks.

Released under GPL-3.0-or-later.