> ## Documentation Index
> Fetch the complete documentation index at: https://learn.nextedy.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Form Extension

> Reference for the Nextedy MEDIAKIT work item form extension — its identifier and attributes.

export const LastReviewed = ({date}) => {
  if (!date) return null;
  const formatted = new Date(`${date}T00:00:00Z`).toLocaleDateString("en-US", {
    year: "numeric",
    month: "long",
    day: "numeric",
    timeZone: "UTC"
  });
  return <p className="mt-10 text-sm text-gray-400 dark:text-zinc-500 not-prose">
      Last reviewed on {formatted}
    </p>;
};

The gallery is added to a work item form by placing an `extension` element in the form layout. For the procedure, see [Adding the Gallery](/mediakit/getting-started/adding-the-gallery).

```xml theme={null}
<extension id="MediaFormExtension" label="Mediakit" mode="grid" height="400"/>
```

## Attributes

| Attribute | Required | Default | Description                                                                              |
| --------- | -------- | ------- | ---------------------------------------------------------------------------------------- |
| `id`      | yes      | —       | Always `MediaFormExtension`. Identifies the Mediakit gallery.                            |
| `label`   | no       | —       | The section heading shown on the form. Choose whatever suits the project.                |
| `mode`    | no       | `grid`  | Which view the gallery opens in: `grid` or `table`. Readers can switch views afterwards. |
| `height`  | no       | `400`   | Height of the gallery area, in pixels.                                                   |

### `mode`

`grid` opens on tiles — a thumbnail per image, an icon per other file. `table` opens on the list view, which shows the full file name, size, author and date.

This sets the **initial** view only. The gallery's toolbar lets a reader switch between the two at any time, and that choice is theirs, not a configuration setting.

### `height`

Sets the height of the gallery area in pixels. The rendered section is slightly taller than this value, because the surrounding frame adds its own chrome.

## Placement in the Layout

The extension is an ordinary form-layout element and can go wherever the section belongs. Placing it immediately after the `attachments` field puts the gallery directly below Polarion's own attachment table:

```xml theme={null}
<field id="attachments"/>

<extension id="MediaFormExtension" label="Mediakit" mode="grid" height="400"/>
```

Omitting the `attachments` field entirely gives a form with the gallery alone.

## One Layout per Work Item Type

<Warning>
  **Form layouts are per work item type, and the wrong one fails silently.**

  Polarion stores a separate form layout for each work item type. Adding the extension to a layout that the item does not use produces no gallery, no error and no warning — the form simply renders without it.

  The **-- Unspecific --** layout applies only to types that have no layout of their own, so adding the extension there does not cover a type that has one.

  Add the extension to the layout of every work item type that should show the gallery.
</Warning>

## Related

<Columns cols={2}>
  <Card title="Adding the Gallery" icon="images" href="/mediakit/getting-started/adding-the-gallery">
    The step-by-step procedure.
  </Card>

  <Card title="Widget Parameters" icon="sliders" href="/mediakit/reference/widget-parameters">
    The equivalent settings for the rich page widget.
  </Card>
</Columns>

<LastReviewed date="2026-09-03" />
