Add Page Widget
add_page_widget · Tools · Pages
Place a widget on a page
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
config | string | No | The widget's configuration as JSON object text. Leave out for a widget that takes none. |
expected_revision | integer | Yes | The revision get_page returned. |
route_slug | string | Yes | The board page's route slug. |
title | string | No | A heading for the widget. |
weight | number | No | How much room it takes beside its siblings, 0.25 to 12. Defaults to 1. |
widget_type | string | Yes | A widget type from list_widget_types. |
Places a widget at the end of a board page.
widget_type must be one list_widget_types names. A type nothing declares is refused here, even though the REST API lets one through — a client newer than the server is a real situation, but an agent naming a widget that does not exist has invented it, and the result would be a gap on the page.
The configuration is checked before anything is stored: against the widget's schema where it has one, and against the Data View document shape for a Data View. A widget nobody has described accepts whatever it is given, so copy an existing one of that type rather than guessing.
Returns the new node id, which is how patch_page_widget names it later.