Menu Layouts
Layouts dynamically fill a set of slots with items from a collection — the primary tool for building paginated lists, inventories, leaderboards, and any other variable-length content.
How Layouts Work
A
LayoutBlueprintis defined in the menu'slayouts:map.At compute time a
LayoutInstanceis created and bound to a data provider.Items tagged with the layout's
taintare distributed across the layout's slots.Pagination is handled via
next-page,previous-page, andfirst-pageactions.
Blueprint Fields
Field | Type | Description |
|---|---|---|
| String (placeholder) | Resolves to a |
| String | Only |
|
| When any fails the layout renders nothing. |
Data Providers
The provider placeholder must resolve to one of:
Type | Description |
|---|---|
| Each element is rendered as one layout slot. The element's placeholder context is active while rendering that slot's item. |
| Each key-value pair is exposed as a placeholder context per slot. |
| Custom Java interface for programmatic item generation. |
Providers are typically passed as parameters when opening the menu:
Slot Assignment
Layout slots are defined by associating items with the layout's taint. The slots those items occupy become the layout's available slots. Items are distributed in slot-index order.
Pagination
When the provider has more items than available slots, the layout is automatically paginated.
The current page number is accessible via %layout.items.page% and the total page count via %layout.items.pages%.
Layout Placeholders
Inside items that belong to a layout the following placeholders are available:
Placeholder | Description |
|---|---|
| Current page index (0-based) |
| Total number of pages |
| Total number of items in the provider |
| Index of the current item within the full provider |