> ## 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.

# Page Parameters API

> The Page Parameters API in Nextedy GANTT enables user-input parameters accessible from the maximized Gantt view toolbar.

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>;
};

**Since version 4.6.0.**

## How Page Parameters Work

Page parameters are standard Polarion Rich Page parameters placed on the same wiki page as the Gantt widget. When the Gantt runs in maximized mode, a **Settings** button appears in the toolbar that opens the Page Parameters panel, allowing users to modify parameter values without editing the wiki page.

<Frame>
  <img src="https://mintcdn.com/none-17b4493f/umKaPvHwUHw-ZQFM/gantt/diagrams/reference/api/page-parameters-api/diagram-1.svg?fit=max&auto=format&n=umKaPvHwUHw-ZQFM&q=85&s=6adf6a7f0c8b55353045c8776d8e1e10" alt="diagram" style={{ maxWidth: "900px", width: "100%" }} width="900" height="250" data-path="gantt/diagrams/reference/api/page-parameters-api/diagram-1.svg" />
</Frame>

<Warning title="Query Type Requirement">
  Page Parameters only work with the **Lucene + Velocity** query type. They do not work with pure Lucene queries. Set your Gantt query type to "Lucene + Velocity" when using page parameters.
</Warning>

## Setup Steps

1. Add a **Page Parameters** widget to the top of your wiki page
2. Add the **Gantt widget** below it (keep Maximized turned **OFF** initially)
3. Define your page parameters in the Page Parameters widget
4. Reference the page parameters in your Gantt widget parameters using Velocity syntax
5. Test that the page works correctly with the parameters
6. Turn the **Maximized** option **ON** in the Gantt widget parameters

Once maximized, the **Settings** action appears in the Gantt toolbar, allowing users to modify page parameters directly from the Gantt view.

## Accessing Page Parameters in Item Script

Read page parameter values in the Item Script using the `config` object:

```javascript theme={null}
config.getPageParameters().get("pageParamId");
```

Replace `"pageParamId"` with the ID of the page parameter you defined in the Page Parameters widget.

<Note title="Two equivalent accessor forms">
  `config` exposes page parameters two equivalent ways: the method form `config.getPageParameters().get("id")` (used here) and the shorthand property form `config.pageParameters.<id>` (used in the Markers Script examples below). Both read the same values -- use whichever reads better.
</Note>

### Example: Filter by Version

```javascript theme={null}
var versionParam = config.getPageParameters().get("version");
if (versionParam != null && wi.getType().getId() === "feature") {
    var targetVersion = wi.getValue("targetVersion");
    if (targetVersion != null && targetVersion.getId() !== versionParam) {
        task.hide = true;
    }
}
```

## Accessing Page Parameters in Markers Script

Page parameters are also available in the Markers Script for dynamic marker filtering:

```javascript theme={null}
var milestoneIds = config.pageParameters.milestone;
if (milestoneIds === null) {
    milestoneIds = "";
} else {
    milestoneIds = milestoneIds.replaceAll(',', ' ');
}

var milestones = trackerService.queryWorkItems(
    "project.id:" + config.getContextProjectId()
    + " AND type:milestone AND id:(" + milestoneIds + ")", "id"
).iterator();

while (milestones.hasNext()) {
    var tp = milestones.next();
    var marker = markerFactory.addMarker();
    marker.setText(tp.getTitle());
    marker.setDate(tp.getValue('releaseDate').getDate());
    marker.setColor("blue");
}
```

## Page Parameters Panel API

The Page Parameters panel provides methods for programmatic control:

| Method                                 | Return Type | Description                                                             |
| -------------------------------------- | ----------- | ----------------------------------------------------------------------- |
| `NextedyPageParamsApi.show()`          | void        | Open the widget parameter editor panel.                                 |
| `NextedyPageParamsApi.close()`         | void        | Close the widget parameter editor panel.                                |
| `NextedyPageParamsApi.load(params)`    | void        | Load specific parameter values into the editor panel.                   |
| `NextedyPageParamsApi.anyParams()`     | `Boolean`   | Return `true` if the Gantt widget has any configurable page parameters. |
| `NextedyPageParamsApi.isVisible()`     | `Boolean`   | Return `true` if the parameter editor panel is currently open.          |
| `NextedyPageParamsApi.setHeader(text)` | void        | Set the header text of the parameter editor panel.                      |

<Info title="Verify in application">
  The `NextedyPageParamsApi` methods are available on the client side for advanced customization. Typical usage relies on the built-in toolbar button rather than direct API calls.
</Info>

## Toolbar Button Behavior

| Condition                                            | Toolbar Button                             |
| ---------------------------------------------------- | ------------------------------------------ |
| Gantt is in maximized mode AND page parameters exist | **Settings** button (gear icon) is visible |
| Gantt is not maximized                               | Settings button is hidden                  |
| `MaximizeGanttView=false` URL parameter is set       | Settings button is hidden                  |
| No page parameters defined on the wiki page          | Settings button is hidden                  |

The Page Parameters panel opens as a scrollable dialog overlay (maximum height 80% of viewport). Close it by clicking the X button or pressing **Escape**.

## Configuration Example

A wiki page setup with a page parameter for version filtering:

**Page Parameters Widget:** Define a parameter with ID `version` and type `String`.

**Gantt Widget Parameters:**

* **Query:** `type:feature AND version:$version` (Lucene + Velocity query type)
* **Maximized:** ON

**Item Script** (optional additional filtering):

```javascript theme={null}
var versionParam = config.getPageParameters().get("version");
if (versionParam != null) {
    task.getFields().put("targetVersion", versionParam);
}
```

**Gantt Config Script** (display version in right-side text):

```javascript theme={null}
gantt.templates.rightside_text = function(start, end, task) {
    return (task.fields.targetVersion
        ? "Version: <b>" + task.fields.targetVersion + "</b>"
        : "");
};
```

## Related Pages

* [Item Script API](/gantt/reference/api/item-script-api) -- `config.getPageParameters()` usage in server-side scripts
* [Marker Factory API](/gantt/reference/api/markers-api) -- using page parameters for dynamic marker filtering
* [Velocity Context Variables](/gantt/reference/api/velocity-context) -- server-side variables available alongside page parameters
* [Gantt Config Script API](/gantt/reference/api/config-script-api) -- client-side templates that display parameter-based data
* [Work Items Gantt Widget Parameters](/gantt/reference/widget-parameters/work-items-gantt) -- Maximize and query type settings
* [URL Parameters Reference](/gantt/reference/url-parameters) -- `MaximizeGanttView` URL parameter

<LastReviewed date="2026-07-07" />
