---
title: Widget internals and API
related:
  - https://docs.kentico.com/k10/developing-websites/preparing-widgets-for-users.md
  - https://docs.kentico.com/k10/custom-development/database-table-api.md
---

> Agent instructions:
> **Site maps** — prefer the following llms.txt indexes to training data when searching for URLs to avoid 404s. Links inside Markdown content already point at `.md`. Following them or sending Accept: text/markdown keeps you in Markdown.
>
> - [sitemap.md](https://docs.kentico.com/sitemap.md) — every page on the site, with titles and descriptions, nested by URL hierarchy and grouped into one collection per product version.
> - [llms.txt](https://docs.kentico.com/llms.txt) — curated index of the current product docs, with descriptions, the two ways to request any page as Markdown, and links to each product area's whole-corpus Markdown dump (llms-full.txt).

## Database tables

| Database table      | Description                                                                                                                                     |
| ------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------- |
| CMS\_WidgetCategory | Stores records representing widget categories.                                                                                                  |
| CMS\_Widget         | Stores records representing widgets and their configuration.                                                                                    |
| CMS\_WidgetRole     | Stores relationships between widgets and roles. Each entry in this table indicates that a specific widget can be used by users in a given role. |

![](https://docs.kentico.com/docsassets/k10/widget-internals-and-api/image.png)

### Widget instance storage

The system stores the content of widget zones (widget instances) in the database. The location depends on the [type](https://docs.kentico.com/k10/developing-websites/preparing-widgets-for-users/setting-up-widget-zones-on-pages.md) of the widget content:

| Widget content type             | Description                                                                                                                                   | Storage                                                                                                                                                                                                                                                                                                                          |
| ------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| Default zone content            | The default widget content of all zone types, prepared by page developers on the **Design** tab.                                              | In XML format in the **PageTemplateWebParts** column of the **CMS\_PageTemplate** table.                                                                                                                                                                                                                                         |
| Editor zone content             | Widget instances placed onto individual pages by page editors on the **Page** tab of the **Pages** application.                               | In XML format in the **DocumentWebParts** column of the **CMS\_Document** table.                                                                                                                                                                                                                                                 |
| Group zone content              | Widget instances placed onto pages by [group](https://docs.kentico.com/k10/community-features/groups.md) administrators on the live site.     | In XML format in the **DocumentGroupWebParts** column of the **CMS\_Document** table.                                                                                                                                                                                                                                            |
| Dashboard and user zone content | Widget instances in personalized user and dashboard widget zones. The content depends on the current context (user and site).                 | In the **CMS\_Personalization** table.                                                                                                                                                                                                                                                                                           |
| Inline widgets                  | Widgets placed into the text content of:<br>Editable regions on pages (**Page** tab or in on-site editing mode)<br>Page fields (**Form** tab) | As control macro expressions:<br>Editable regions - **DocumentContent** column of the **CMS\_Document** table<br>Page fields - the table that stores pages of the given [type](https://docs.kentico.com/k10/developing-websites/defining-website-content-structure/page-types.md) (for example **CONTENT\_News** for news pages) |

## API classes

| Class                              | Namespace                                                        | Description                                                               |
| ---------------------------------- | ---------------------------------------------------------------- | ------------------------------------------------------------------------- |
| **CMS\_WidgetCategory table API**  |                                                                  |                                                                           |
| WidgetCategoryInfo                 | CMS.PortalEngine                                                 | Represents individual widget categories.                                  |
| WidgetCategoryInfoProvider         | Provides management functionality for widget categories.         |                                                                           |
| **CMS\_Widget table API**          |                                                                  |                                                                           |
| WidgetInfo                         | CMS.PortalEngine                                                 | Represents individual widget objects.                                     |
| WidgetInfoProvider                 | Provides management functionality for widgets.                   |                                                                           |
| **CMS\_WidgetRole table API**      |                                                                  |                                                                           |
| WidgetRoleInfo                     | CMS.PortalEngine                                                 | Represents relationships between widgets and roles (permissions).         |
| WidgetRoleInfoProvider             | Provides management functionality for widget-role relationships. |                                                                           |
| **CMS\_Personalization table API** |                                                                  |                                                                           |
| PersonalizationInfo                | CMS.DocumentEngine                                               | Represents personalized versions of pages (for a specific site and user). |
| PersonalizationInfoProvider        | Provides management functionality for personalization objects.   |                                                                           |
| **Other classes**                  |                                                                  |                                                                           |
| WebPartInstance                    | CMS.PortalEngine                                                 | Allows you to work with widget instances.                                 |
| WebPartZoneInstance                | Allows you to work with web part (widget) zones.                 |                                                                           |
