Skip to main content

Subpages, lists, and global slots

Reuse a page wherever the same interface appears more than once. A room card, source selector, navigation bar, or volume panel can have its own containers, controls, and parameters. Edit that page once to update every place that embeds it.

This guide uses a room card to explain the three reuse mechanisms in AVstudio Editor NG 27.0.29. For individual property references, see Subpage and Subpage List.

Choose the right mechanism​

RequirementUseHow many instances render?Where the layout is controlled
Embed a reusable room card or control panelSubpageOne per Subpage elementThe element's bounds and the target page's layout
Show one card for every room in a datasourceSubpage ListOne per item in the attached arrayThe parent container in Boxless mode, or the list's Grid settings
Reuse a header, sidebar, or footer around selected screensGlobal slotsOne assigned page per visible slotThe top, left, right, and bottom shared regions

A subpage is an ordinary .page file. It does not need a special file extension. Containers still belong directly to their page: use an embedded page when a group needs its own internal container layout.

Create a reusable subpage​

1. Organize the pages​

Create the host and its reusable card in a module folder:

AVstudio UI/
├── pages/
│ └── rooms/
│ ├── directory.page
│ └── subs/
│ └── card.page
└── datasources/
├── rooms.datasource
└── rooms.json

Use Add page from the pages folder or the relevant subfolder. Open card.page in the visual editor and add a container. This container holds the card's label and controls; it is separate from the host page's containers.

Keep dependent pages inside the module folder when you expect to copy or move the module. Shared pages used by unrelated modules can live in a separate pages/shared/ folder.

2. Define the card's parameters​

With card.page active, run Open page parameters and add:

NameTypeExample defaultPurpose
roomNameStringRoomDisplayed room label
roomIdNumber0Identifier available to the card's logic

Save the parameters in the page’s parameter editor.

3. Build the card content​

  1. Add a Text element and enter %roomName% as its content.
  2. Add a second label such as Room controls.
  3. Add the controls the card needs, such as an Open room button.
  4. Arrange them in the card's container using flow, alignment, padding, and gap.
  5. Save the page. Open it independently to check its default content before embedding it.

Use %roomName% for a page parameter. $roomName$ would read a global variable instead. A reusable card can therefore show a different name in each instance while keeping the same design.

The sample Open room button in the screenshots demonstrates layout only. Add an action explicitly before using it for navigation or equipment control.

4. Embed the card in the host​

  1. Open directory.page and select its destination container.
  2. Choose Add element → Subpage.
  3. Open Element Properties and select card.page as the target page.
  4. Set the input parameters to roomName: Conference Room and roomId: 1.
  5. Give the element enough space for the card and preview the host page.

One room card embedded in a Subpage, with Boardroom passed as its roomName parameter

NG Live Preview: one card receives Boardroom as its room name. The same target page can be embedded again with a different value.

Pass data into an instance​

Declare parameters on the target page, then map values in the host element's input parameters. Parameter names must match exactly, and values should match the declared types.

Input valueExampleUse
Literal"Boardroom"A fixed label for one instance
Host page parameter"%selectedRoomName%"Forward a value from the containing page
Global variable"$buildingName$"Share a value across the project
Current list item's field"#datasources/rooms.datasource:*.name#"Give each repeated card its own room name

Keep per-card values as page parameters. Use global variables for values that should actually be shared, such as the building name or project-wide state.

A whole datasource token preserves the value's type, so a numeric id can populate a number parameter. Embedding that token inside a longer string produces text.

Rendered values and actions

Tokens resolve in supported render properties and input-parameter mappings. Do not assume that putting %roomId% or a datasource token into an action's payload or signal name will substitute it: action fields use their own value handling. Configure actions through the supported workflow in Actions and navigation.

Keep page references portable​

ReferenceMeaningExample
Relative targetSame folder or a descendant of the host page's folder./subs/card.page
Project-root targetA page elsewhere under the project rootpages/shared/navigation.page
Start pageThe project's configured start page/

For pages/rooms/directory.page, ./subs/card.page resolves to pages/rooms/subs/card.page. Copying the whole rooms folder preserves that internal relationship. A reference to pages/shared/navigation.page still depends on the shared page being present.

Relative references apply to subpageName. Page-flip and overlay targets use project-root page references. Global slot references also use project-root paths.

Do not embed a page inside itself, including through a chain such as A → B → A. After renaming or moving pages, check every host, navigation action, and global slot that references them.

Repeat a subpage from data​

A Subpage List repeats its target once per item in the final result of its attached datasource. Attaching a datasource to a normal Subpage does not turn it into a list.

1. Prepare an array datasource​

Create a local datasource using the datasource workflow. For this example, use a local file named datasources/rooms.json:

IDName
1Boardroom
2Meeting room
3Training room
4Lobby

Open rooms.datasource and select rooms.json as its local data file.

The final result must be an array. If a service returns an object such as { "rooms": [...] }, use the datasource selection/filter steps to select its rooms array before using it as the replication source.

2. Attach the datasource and map fields​

  1. On directory.page, insert Subpage List in the destination container.
  2. Select ./subs/card.page as its target.
  3. Expand Attached datasource, select rooms.datasource, and confirm its final result contains the room array.
  4. Map roomName to the current item's name and roomId to the current item's id.
  5. In the dynamic value picker, use All items (N) when selecting per-item fields.

The mappings use * for the current record:

Input parameterDynamic value
roomName#datasources/rooms.datasource:*.name#
roomId#datasources/rooms.datasource:*.id#

The datasource key in each token must exactly match the list's attached datasource key, including the datasources/ prefix and .datasource extension. A fixed index such as 0.name points to the first record; it does not mean “this card's record.”

3. Configure a grid​

For a four-card directory, choose Grid, set two rows and two columns, and add a gap. Enable vertical overflow to keep additional items reachable.

Set the gap to 16 px, arrange items by rows, and enable scrolling.

Set the list's width and height in Element Properties to allocate its visible area. Rows and columns describe the visible matrix; they do not limit the number of records in the datasource.

A two-by-two Subpage List showing Boardroom, Meeting room, Training room, and Lobby

Four local datasource records render four instances of one card page. Each instance receives its own roomName value.

4. Check overflow and empty results​

Add a fifth record. With row flow and scrolling enabled, it should occupy the next row below the visible matrix. Then test one record and an empty array.

An empty array is a valid empty list. If the screen needs a “No rooms available” message, design that empty state explicitly; the editor's diagnostic overlay is not a production message.

Choose the list layout​

SettingBoxlessGrid
Layout ownerParent container arranges the instancesList element divides its own box into cells
List width and heightInactive for a boxless list on a responsive pageDefine the visible matrix area
Background, border, padding, shadowNo independent box to style on a responsive pageApply to the list's box
SpacingUse the parent container's layout and gapUse the list's gap
Typical useCards that flow with other container childrenA bounded room directory or source browser

Boxless: In a responsive page, each instance is laid out directly by the parent container using the target subpage's size. In a fixed page, the list retains a positioned box; instances stack and fill the cross axis.

Grid: Each cell holds one instance. If the target page has custom dimensions enabled, it uses those dimensions; otherwise it fills the cell. Leave custom target sizing off when the card should adapt to the available cell area.

Grid optionResult
gridFlow: "row"Fill across each row; extra rows extend downward
gridFlow: "column"Fill down each column; extra columns extend rightward
scrollMode: "scroll"Scroll with a visible scrollbar
scrollMode: "scrollHidden"Scroll with the scrollbar hidden
scrollMode: "disabled"Overflow is not scrollable

When an element setting is unset, the list can inherit its grid and scrolling defaults from the active theme. Set explicit values when an individual list needs different behavior.

Selection context and item animation​

In 27.0.29, Subpage List supplies a key and selected flag to every item page through %avstudio_listItemKey% and %avstudio_listItemIsSelected%. Set listKey using the current record’s ID and bind activeSelectedListKey to the shared selection. See Selected-item context for reserved names and diagnostics.

Use itemAnimate and itemAnimateDelay for repeated-instance entrance effects, separately from the animation of the whole list box. See Visibility and entrance animations.

Global slots​

Global slots place ordinary pages in shared top, left, right, and bottom regions around the main page. Use them for a header, navigation sidebar, status area, or footer that should be maintained in one place.

Room directory in NG Live Preview, surrounded by a shared top header and bottom footer

The room directory is the main page. The header and footer are separate pages assigned to global slots. The sample slot rules show them only on this directory screen.

Create and assign shared pages​

  1. Create a shared page such as pages/shared/header.page and build its title, status labels, or navigation controls.
  2. Create pages/shared/footer.page if you also need a footer.
  3. Run Open Global Slots from the Command Palette, AV Studio Hub → Slots, or Quick Actions in 27.0.41. You can also open global.slots in Explorer using the Forms Editor; use this file workflow on 27.0.29, whose manifest has no separate slots command.
  4. Assign the header page to Top and the footer page to Bottom. Leave unused regions empty.
  5. Configure visibility for each slot independently.
  6. Preview a page where each slot should appear and a page where it should be hidden.

The screenshot example uses an 80 px high header and a 64 px high footer, with their source pages sized for those shared bands. Choose dimensions appropriate for your interface and verify how much space remains for the main page. These example heights are not required defaults.

Edit the assigned source page to update every screen that displays that slot. global.slots holds references and visibility rules, not a separate copy of the page content.

Configure visibility​

Default visibilityActive page listBehavior
VisiblehiddenOnPagesShow everywhere except the listed pages
HiddenvisibleOnPagesShow only on the listed pages

Only the list matching the default-visibility flag is used. The other list is ignored; it is not an additional override.

For example, this configuration shows a header everywhere except login, and a footer only on the room directory:

Assign pages/shared/header.page to the top slot, enable default visibility, and add pages/login.page to its hidden-page list. Assign pages/shared/footer.page to the bottom slot, disable default visibility, and add pages/rooms/directory.page to its visible-page list. Leave the left and right slots unassigned.

Create the referenced pages before assigning them. Use paths from the project root. Clear the assigned page to remove a slot; an unassigned slot renders nothing.

Editor visibility versus runtime visibility​

The canvas checkbox Global slots visibility only shows or hides slots while editing the current page. It is an editor viewing preference, stored per page; it does not change Live Preview or the exported interface.

Use global.slots to change runtime visibility. If a slot appears in preview but not on the editor canvas, check the canvas checkbox before changing the shared page or its visibility rules.

Troubleshooting​

Symptom or editor messageWhat to check
Select SubpageAssign a target page in the element properties.
Subpage … not foundCheck the path relative to the host; verify the target still exists after a move or rename.
Datasource is not attachedAttach an array-producing datasource to the Subpage List itself.
Datasource result is not a listSelect the array within a response object or correct the datasource formatter.
Empty listInspect the data and filters. An empty array creates no card instances.
A %parameter% token remains visibleDeclare the parameter on the target and match its name exactly.
A datasource token remains visibleCheck the full datasource key, field path, and matching current-item scope.
Every card shows the first roomUse *.name for per-item mapping instead of 0.name.
Cards are clipped or unexpectedly largeCheck list dimensions, cell count, gap, target-page custom sizing, and scrolling.
A normal Subpage does not repeatReplace it with Subpage List and attach the datasource to that list.
A global slot appears on the wrong pageCheck the page path, default visibility, and the active exception list.
Canvas and preview show different slotsThe canvas visibility checkbox is separate from runtime rules.

Diagnostic overlays such as Empty list appear only in the editor. In preview and production, a grid list retains its empty box, while a boxless list on a responsive page renders no instances. Do not rely on diagnostic text as the interface's empty-state design.

Verify the complete workflow​

  1. Save the card, host page, datasource, and slot settings; run Run Project Health Check.
  2. Preview a single card with two different parameter sets and confirm the labels differ.
  3. Test a list with zero, one, four, and more than four records. Confirm every card gets the correct record.
  4. Test grid flow and scrolling at the intended screen sizes and orientations.
  5. Navigate between pages with different slot visibility rules.
  6. Change a label in the shared header and verify every visible instance updates.
  7. Test actions inside the card and shared navigation separately from their visual layout.

Continue with Containers and responsive layout, Variables and parameters, Datasources, and Actions and navigation.

Subpage changes in 27.0.x​

New Subpage Lists default to the grid variant; boxless is opt-in. Existing saved variants remain their own configuration. Target Subpage accepts dynamic bindings and its Content section opens automatically while the target is unset. An unconfigured subpage remains visible in the editor rather than collapsing to zero size.

Attached datasource controls are shown inline in Element Properties; filter controls appear after attachment. Subpage warning borders are not enabled by default. Properties panels retain state when hidden and resynchronize on show.

Input Parameters can pass Crestron feedback tokens, including a different join for each datasource item. The runtime resolves the item path before feedback. In the 27.0.5 design canvas the declared target-parameter default is used instead of displaying raw feedback token text.